OFBiz
  1. OFBiz
  2. OFBIZ-1372

Enhance the integration with Google Product

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: SVN trunk
    • Fix Version/s: SVN trunk
    • Component/s: None
    • Labels:
      None
    • Environment:

      mac os x

      Description

      This is the first patch for implementing the new Google Base application, this job is still not completed it's only a preview if someone wants to check it.

      Thanks
      Marco

      1. google_2.patch
        23 kB
        Marco Risaliti
      2. google.patch
        62 kB
        Marco Risaliti
      3. googlebase_new3.patch
        58 kB
        Adrian Crum
      4. googlebase_new3.patch
        58 kB
        Marco Risaliti
      5. googlebase_new4.patch
        61 kB
        Marco Risaliti
      6. googlebase_new5.patch
        66 kB
        Marco Risaliti
      7. googlebase.zip
        125 kB
        Marco Risaliti

        Activity

        Hide
        Marco Risaliti added a comment -

        This is the new google base application to be insert into the specialpurpose folder.

        Show
        Marco Risaliti added a comment - This is the new google base application to be insert into the specialpurpose folder.
        Hide
        Marco Risaliti added a comment -

        This is the patch for removing the google base integration from the product application.

        Show
        Marco Risaliti added a comment - This is the patch for removing the google base integration from the product application.
        Hide
        Marco Risaliti added a comment -

        The method ProductSearchEvents.searchExportProductListToGoogle is still in the product application and I have to check if has to be moved or not.
        In this moment I have removed the left side of advanced search into the catalog in the new google base application.
        And still remain to understand hwo to handle the permission for this new application.
        Please let me know your ideas before continue and finish this new implementation.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - The method ProductSearchEvents.searchExportProductListToGoogle is still in the product application and I have to check if has to be moved or not. In this moment I have removed the left side of advanced search into the catalog in the new google base application. And still remain to understand hwo to handle the permission for this new application. Please let me know your ideas before continue and finish this new implementation. Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        Marco,

        looks great.
        About the permission, I'd suggest to start in a very simple way: we could add a new GOOGLEBASE_VIEW permission (the seed data should be in a file named data/GooglebaseSecurityData.xml) and add GOOGLEBASE to the base permission attribute in the ofbiz-controller.xml:

        base-permission="OFBTOOLS,GOOGLEBASE"

        For an example, have a look at the Oagis component.

        It would be great to move the ProductSearchEvents.searchExportProductListToGoogle method into a new class in the googlebase component.

        By the way, what if we commit this first step?

        Thanks,

        Jacopo

        Show
        Jacopo Cappellato added a comment - Marco, looks great. About the permission, I'd suggest to start in a very simple way: we could add a new GOOGLEBASE_VIEW permission (the seed data should be in a file named data/GooglebaseSecurityData.xml) and add GOOGLEBASE to the base permission attribute in the ofbiz-controller.xml: base-permission="OFBTOOLS,GOOGLEBASE" For an example, have a look at the Oagis component. It would be great to move the ProductSearchEvents.searchExportProductListToGoogle method into a new class in the googlebase component. By the way, what if we commit this first step? Thanks, Jacopo
        Hide
        Marco Risaliti added a comment -

        Hi Jacopo,

        I agree with your suggestions and I can do those changes on the next days.
        In the same moment if you want to commit this first step for me it's ok.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Jacopo, I agree with your suggestions and I can do those changes on the next days. In the same moment if you want to commit this first step for me it's ok. Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        Comment your work (plus mine) is in rev. 589315 and 589317
        I've used different approaches from yours but the end result should be the same.
        Thanks!

        Show
        Jacopo Cappellato added a comment - Comment your work (plus mine) is in rev. 589315 and 589317 I've used different approaches from yours but the end result should be the same. Thanks!
        Hide
        Marco Risaliti added a comment -

        This is the second patch that implements:

        • the security for the google base application
        • the method searchExportProductListToGoogle is moved in the new class GoogleBaseSearchEvents

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - This is the second patch that implements: the security for the google base application the method searchExportProductListToGoogle is moved in the new class GoogleBaseSearchEvents Thanks Marco
        Hide
        Marco Risaliti added a comment -

        Hi Jacopo,

        also I prefer your different approaches on keywordsearch that now is more reusable in different places.
        I have also two new ideas :

        • instead of looking for GoodIdentification for a google product only if one specify insert in the form we can che everytime if the product is in GoodIdentification then for us is an update.

        String googleProductId = null;
        if (!"insert".equals(actionType)) {
        try {
        GenericValue googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID"));
        if (UtilValidate.isNotEmpty(googleProduct))

        { googleProductId = googleProduct.getString("idValue"); }
        } catch(GenericEntityException gee) { Debug.logError("Unable to get the Google id for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); }
        }
        if ("update".equals(actionType) && UtilValidate.isEmpty(googleProductId)) { itemActionType = "insert"; }


        String googleProductId = null;
        try {
        GenericValue googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID"));
        if (UtilValidate.isNotEmpty(googleProduct)) { googleProductId = googleProduct.getString("idValue"); }

        } catch(GenericEntityException gee)

        { Debug.logError("Unable to get the Google id for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); }

        }

        so if googleProductId is not null then we will send an update on google.
        Because now if you have already the product sent to google and you send again the same product with an insert action you will have double products on google.

        • Why don't we add a new tab in the google base application to show which products are sent to google base reading the table GoodIdentification with code GOOGLE_ID ?

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Jacopo, also I prefer your different approaches on keywordsearch that now is more reusable in different places. I have also two new ideas : instead of looking for GoodIdentification for a google product only if one specify insert in the form we can che everytime if the product is in GoodIdentification then for us is an update. String googleProductId = null; if (!"insert".equals(actionType)) { try { GenericValue googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID")); if (UtilValidate.isNotEmpty(googleProduct)) { googleProductId = googleProduct.getString("idValue"); } } catch(GenericEntityException gee) { Debug.logError("Unable to get the Google id for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); } } if ("update".equals(actionType) && UtilValidate.isEmpty(googleProductId)) { itemActionType = "insert"; } String googleProductId = null; try { GenericValue googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID")); if (UtilValidate.isNotEmpty(googleProduct)) { googleProductId = googleProduct.getString("idValue"); } } catch(GenericEntityException gee) { Debug.logError("Unable to get the Google id for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); } } so if googleProductId is not null then we will send an update on google. Because now if you have already the product sent to google and you send again the same product with an insert action you will have double products on google. Why don't we add a new tab in the google base application to show which products are sent to google base reading the table GoodIdentification with code GOOGLE_ID ? Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        Thanks Marco,

        your patch is in rev. 589499

        Show
        Jacopo Cappellato added a comment - Thanks Marco, your patch is in rev. 589499
        Hide
        Jacopo Cappellato added a comment -

        Marco,

        I agree with you about the googleProductId: what you propose is the right way to go.

        I also like the idea of having a new screen to list products sent to Google: however we will probably need a search screen as well because the number of products sent to google could be very high: we could probably reuse (again) the advanced search screen (and hiding somewhere the condition on GOOGLE_ID not null)... just my 2 cents.

        Show
        Jacopo Cappellato added a comment - Marco, I agree with you about the googleProductId: what you propose is the right way to go. I also like the idea of having a new screen to list products sent to Google: however we will probably need a search screen as well because the number of products sent to google could be very high: we could probably reuse (again) the advanced search screen (and hiding somewhere the condition on GOOGLE_ID not null)... just my 2 cents.
        Hide
        Marco Risaliti added a comment -

        That's a new patch that includes a new feature to search products by Good Identification Type/Value and so now it can be used also to see which products are exported to Google Base.
        Then I have tried to applied the new style sheets to this new application.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - That's a new patch that includes a new feature to search products by Good Identification Type/Value and so now it can be used also to see which products are exported to Google Base. Then I have tried to applied the new style sheets to this new application. Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        Marco, it looks really interesting.

        My only concern is about the new style:

        • we should avoid to insert html specific code into the screen definition (they should be as much html independent as possible); could you please
        • would it be possible to provide a patch without layout changes? From the patch it is very difficult to understand what has been modified in the advancedsearch.ftl and keywordsearch.ftl templates

        Thanks

        Show
        Jacopo Cappellato added a comment - Marco, it looks really interesting. My only concern is about the new style: we should avoid to insert html specific code into the screen definition (they should be as much html independent as possible); could you please would it be possible to provide a patch without layout changes? From the patch it is very difficult to understand what has been modified in the advancedsearch.ftl and keywordsearch.ftl templates Thanks
        Hide
        Marco Risaliti added a comment -

        Hi Jacopo,

        also I didn't like to insert this type of code into the screen definition:

        <label text="<table><tr><td style="head3"><b>$

        {uiLabelMap.PageTitleGoogleBaseProductsExportToGoogle}</b></td></tr></table>"/>

        but this is the only solution I have found for the moment.
        The issue is due that if I use simple the label tag it uses the span html tag and then the layout is not correct.
        <ul>
        <li class="head3">${uiLabelMap.PageTitleGoogleBaseProductsExportToGoogle}

        </li>
        </ul>
        <br class="clear" />

        Probably we can implement a table tag into the screen widget or a different solution that I didn't know.

        For the advancedsearch.ftl and keywordsearch.ftl I have reformatted all the source because it was unreadable to me and I have follow the 4 spaces indentation.
        By the way apart the reformatting I have simple change the header/the footer of the form and add two new fields (Good Identification Type/Value).

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Jacopo, also I didn't like to insert this type of code into the screen definition: <label text="<table><tr><td style="head3"><b>$ {uiLabelMap.PageTitleGoogleBaseProductsExportToGoogle}</b></td></tr></table>"/> but this is the only solution I have found for the moment. The issue is due that if I use simple the label tag it uses the span html tag and then the layout is not correct. <ul> <li class="head3">${uiLabelMap.PageTitleGoogleBaseProductsExportToGoogle} </li> </ul> <br class="clear" /> Probably we can implement a table tag into the screen widget or a different solution that I didn't know. For the advancedsearch.ftl and keywordsearch.ftl I have reformatted all the source because it was unreadable to me and I have follow the 4 spaces indentation. By the way apart the reformatting I have simple change the header/the footer of the form and add two new fields (Good Identification Type/Value). Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        I see...
        well, I don't think we should even use html tables for to implement the screen layout but, at the moment, I don't know what is the best solution.
        Hopefully one of the layout gurus (Adrian?) out there will provide a css solution

        Show
        Jacopo Cappellato added a comment - I see... well, I don't think we should even use html tables for to implement the screen layout but, at the moment, I don't know what is the best solution. Hopefully one of the layout gurus (Adrian?) out there will provide a css solution
        Hide
        Adrian Crum added a comment -

        Attached patch is the same as the original, but I updated it to the latest SVN and I eliminated deprecated styles from the HTML.

        The previous/next navigation table could be replaced by an unordered list and placed in the screenlet title bar.

        The ugly <label> element in specialpurpose/googlebase/widget/GoogleBaseScreens.xml could be eliminated if the patch in OFBIZ-875 was committed.

        Show
        Adrian Crum added a comment - Attached patch is the same as the original, but I updated it to the latest SVN and I eliminated deprecated styles from the HTML. The previous/next navigation table could be replaced by an unordered list and placed in the screenlet title bar. The ugly <label> element in specialpurpose/googlebase/widget/GoogleBaseScreens.xml could be eliminated if the patch in OFBIZ-875 was committed.
        Hide
        Marco Risaliti added a comment -

        Hi Jacopo & Adrian,

        This patch replace all the others.
        I have followed the suggestion by Adrian in advancedSearch.ftl about wrong UI in the screen title bar and now it's better.
        Then about the main issue for the screen widget I have found a different solution all base into the main.css without adding the patch into the issue OFBIZ-875.
        I have simply insert a new head4 tag into the main.css and used into the screenwidget GoogleBaseScreens.xml and now the <label> element is not more ugly and now is more readable.
        Please let me know what you and the others developer think about it.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Jacopo & Adrian, This patch replace all the others. I have followed the suggestion by Adrian in advancedSearch.ftl about wrong UI in the screen title bar and now it's better. Then about the main issue for the screen widget I have found a different solution all base into the main.css without adding the patch into the issue OFBIZ-875 . I have simply insert a new head4 tag into the main.css and used into the screenwidget GoogleBaseScreens.xml and now the <label> element is not more ugly and now is more readable. Please let me know what you and the others developer think about it. Thanks Marco
        Hide
        Adrian Crum added a comment -

        Marco,

        It would help if your work started with the patch I supplied. Your latest patch includes the deprecated styles I eliminated in my patch.

        Show
        Adrian Crum added a comment - Marco, It would help if your work started with the patch I supplied. Your latest patch includes the deprecated styles I eliminated in my patch.
        Hide
        Marco Risaliti added a comment -

        Hi Adrian,

        I have seen only this comment in the patch you provide:
        + <h3>$

        {uiLabelMap.ProductAdvancedSearchinCategory}</h3>
        + <#-- Commented out the Find button for now. For some reason it whacks out the
        + layout - even though it shouldn't -->
        + <#-- <ul>
        + <li class="head3">${uiLabelMap.ProductAdvancedSearchinCategory}

        </li>
        + <li><a href="javascript:document.advtokeywordsearchform.submit()">$

        {uiLabelMap.CommonFind}

        </a></li>
        + </ul>
        + <br class="clear"/> -->

        and I have include it without the commented code, can you give an example so I can understand what you mean ?

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Adrian, I have seen only this comment in the patch you provide: + <h3>$ {uiLabelMap.ProductAdvancedSearchinCategory}</h3> + <#-- Commented out the Find button for now. For some reason it whacks out the + layout - even though it shouldn't --> + <#-- <ul> + <li class="head3">${uiLabelMap.ProductAdvancedSearchinCategory} </li> + <li><a href="javascript:document.advtokeywordsearchform.submit()">$ {uiLabelMap.CommonFind} </a></li> + </ul> + <br class="clear"/> --> and I have include it without the commented code, can you give an example so I can understand what you mean ? Thanks Marco
        Hide
        Adrian Crum added a comment -

        Marco,

        Please disregard my last comment - it appears I missed some deprecated styles.

        Show
        Adrian Crum added a comment - Marco, Please disregard my last comment - it appears I missed some deprecated styles.
        Hide
        Marco Risaliti added a comment -

        Hi Adrian,

        so if I have understood correctly now it's ok, can be now review and/or commit so I can complete this enhanced about Google Base and so I can start the new enhanced about the new eBay upcoming OFBiz application.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - Hi Adrian, so if I have understood correctly now it's ok, can be now review and/or commit so I can complete this enhanced about Google Base and so I can start the new enhanced about the new eBay upcoming OFBiz application. Thanks Marco
        Hide
        Jacopo Cappellato added a comment -

        Marco,

        after a very quick review your last patch seems good.
        You should soon have all the commit privileges to commit it, so I'm assigning it to you.

        Show
        Jacopo Cappellato added a comment - Marco, after a very quick review your last patch seems good. You should soon have all the commit privileges to commit it, so I'm assigning it to you.
        Hide
        Marco Risaliti added a comment -

        This is a new patch, I have solved the broken link from the keywordsearch to the EditProduct page.

        Thanks
        Marco

        Show
        Marco Risaliti added a comment - This is a new patch, I have solved the broken link from the keywordsearch to the EditProduct page. Thanks Marco
        Hide
        Marco Risaliti added a comment -

        Fixed in rev. 603733,603734,603735

        Show
        Marco Risaliti added a comment - Fixed in rev. 603733,603734,603735
        Hide
        Jacques Le Roux added a comment -

        Hi Marco, in OFBiz we prefer to close task when done, thanks.

        Show
        Jacques Le Roux added a comment - Hi Marco, in OFBiz we prefer to close task when done, thanks.

          People

          • Assignee:
            Marco Risaliti
            Reporter:
            Marco Risaliti
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development