Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-4504

Issues with the Guestbook Tutorial


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 7.0.x
    • Component/s: Website
    • Labels:


      1.  Imports. Except in a very few cases, the tutorial does not tell you what to
      import. In most cases, I was able to figure it out. I noted several cases
      where I needed help or found myself guessing blindly. In some cases, it was
      possible import the wrong files while still resolving all the errors flagged
      by eclipse--but causing more trouble down the road. I think the simplest
      improvement here would be to insert text along the lines of "Remember to check
      the solution at <aabbcc> if you aren't sure which files to import."

      2.  Creating a Working Prototype/Displaying guestbook entries: unsure what to
      import. I wasn't until long after this point that I realized I could check the

      3.  Generating the Back-end/Implementing service methods/step 4 (the first step
      4 on the page): The tutorial gives you a list of things to import, but it's

      4. Refactoring the prototype/organizing folders for larger applications:
      After moving view.jsp and edit_entry.jsp to the guestbookwebportlet
      folder, view.jsp needs to be edited to find edit_entry.jsp at the new location.

      5.  Writing an administrative portlet/updating your service layer:
      com.liferay.docs.gradebook.service.impl. Probably not going to trip anybody up.

      6. Writing an Administrative Portlet/Updating your service layer: Further down
      the page, had to guess at what to import.

      7. Writing an Adminstrative Portlet/Defining portlet actions. I'm guessing
      pretty blindly at what should be imported. (Turns out what I need is

      8.  Displaying Messages and Errors/Adding Failure and Success messages:
      Step 1 (the first step 1): There are two try-catch blocks in the addEntry
      method, not one. Also, the code which the learning path tells me to paste into
      place is already there.

      9. Displaying Messages and Errors/Adding Failure and Success messages: Step 2
      (the first step 2): the code I'm told to find (Logger.getLogger etc) does
      not exist in the addEntry method. Probably it gets added later.

      10: Leveraging Search:

      10a:    Leveraging Search/Enabling Search and Indexing for Guestbooks,/Creating
      a Guestbook Indexer. I know I should be leaving errors in GuestbookIndexer.java,
      but since I'm guessing on what to import, I don't know whether the errors are
      the "right" ones or when they should be corrected. As it turns out, I had more
      errors than I should have at the end of this section, and they didn't correct
      themselves. It would be helpful to identify what the errors should be and at
      what point in the tutorial they should be resolved.

      Also on this page, I suspect there's somthing wrong with the brackets {} in
      the material to be copy/pasted, but it's also possible I made a mistake.

      Bottom of the same page (still Creating a guestbook indexer). The export
      package in api's bnd.bnd does not match the tutorial. Instructions indicate that
      api should export permissions, but Using Resources and Permissions/Creating
      Permissions Helper Classes says that Permissions should be exported by service.
      There also seems to be an issue with search--it looks like both search and
      permissions should be exported by service, but the tutorial says to export from

      10b:    Leveraging Search/Enabling Search and Indexing for Guestbook
      Entries/Creating an Entry Indexer Step 1--we should be working in the service
      module, not the API.

      Leveraging Search/Enabling Search and Indexing for Guestbook Entries/Creationg
      an Entry Indexer: a bunch of things need to be imported at the end of this. To
      get all the imports I need, the code below needs to be in the service module's
      build.gradle (at least, javax portlet should be there? Maybe the others aren't
      necessary until later). I can't find any point in the instructions up to now
      that should have added these items.

        compileOnly group: "com.liferay", name: "com.liferay.registry.api", version:
          compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
          compileOnly group: "javax.servlet", name: "javax.servlet-api", version:

      Note: portlet and servlet are added in Assets: Integrating with
      Liferay's Framework/Enabling Assets at the Service Layer. Liferay
      registry.api is added in Generating Web Services/Creating Remote Services. One
      or more of these dependencies is being added too late, preventing the portlet
      from functioning properly at the end of Leveraging

      11. Assets:Integrating with Liferay's Framework/Enabling Assets at the Service
      Layer/Handling Assets at the Entry Service Layer: the parentheses () are
      missing from the serviceContext.getScopeGroupId method call. Eclipse catches
      the error and it shouldn't trip up an experienced developer, but it confused me
      for minute.

      12. Assets: Integrating with Liferay's Framework/Adding Asset Features to Your
      User Interface/Enabling Comments and Ratings for Guestbook Entries: The final
      step on this page is to add code to entry_actions.jsp which is already there. It
      was added at Using Resources and Permissions/Permissions in JSPs.

      13. In Generating Web Services/Creating Remote Services with Service Builde,
      the tags given in step 1 do not exactly match the text of service.xml.

          <entity name="Guestbook" local-service="true" uuid="true">

          <entity name="Entry" local-service="true" uuid="true">

      is given in the instructions.

          <entity local-service="true" name="Guestbook" uuid="true">
          <entity local-service="true" name="Entry" uuid="true">
      is what I have in service.xml. I don't think functionality is affected--it just
      takes longer to find the tags.

      14. Generating Web Services/Creating Remote Services: it would be helpful to
      specify where the imports go in settings.gradle. "before the buildscript

      15. The intro to workflow indicates that guest users can post whatever they
      want to the guestbook. That's a little confusing becuase in Permissions we hid
      the "Add Entry" button from guests. Workflow intro should probably be edited to
      refer simply to "users".

      16. Using Workflow/Supporting Workflow at the Service Layer/Setting the
      Guestbook Status:to resolve errors at the end of this section, it's apparently
      necessary to refresh gradle.

      17. In Using Workflow/Supporting Workflow at the Service Layer/Setting
      the Guestbook status: instructions say to add a reference tag (<reference
      entity="WorkflowInstanceLink" package-path="com.liferay.portal" />_) after
      existing reference tags in service.xml. I think it means to do that only in the
      guestbook entity, becuase in the next section it says to do the same for the
      reference tags in the entry entity. It doesn't matter too much because the code
      is the same, but someone following the instructions blindly might produce
      duplicative code.

      18. Using Workflow/Supporting workflow at the service layer/Retrieving
      Guestbooks and Entries by status: the instructions say to add a new finder to
      service.xml's guestbook entity and another to its entry entity. Errors result,
      probably because of finders previously added in Assets: Integrating with
      Liferay's Framework/Enabling Assets at the Service Layer. Following the
      instructions creates two finders in each entity where the solution only has
      one. To resolve the issue, the following finder

      <finder name="G_S" return-type="Collection">
          <finder-column name="groupId" />
          <finder-column name="status" />

      should be removed from the the entry entity before putting the new one in. The
      guestbook entity can be left alone, as the new finder from Workflow simply
      duplicates the one already there.

      19. Ok. This is a weird one. Upon reaching the end of the guestbook tutorial,
      I've found an error due to guestbookadminportlet/view.jsp containing the

          total="<%= GuestbookLocalServiceUtil.getGuestbooksCount(scopeGroupId) %>">
          java.lang.Integer deprecatedTotal = (java.lang.Integer)


      It ought to look like this:

          total="<%= GuestbookLocalServiceUtil.getGuestbooksCount(scopeGroupId) %>">
                              searchContainer.getEnd())%>" />

          I cannot account for the line starting in java.lang.Integer. I can't have
      typed it, and  can't have pasted it because that line doesn't appear on
      dev.liferay--or anywhere else on the internet, for that matter. Googling
      suggests it may have been generated by an eclipse bug, but I can't say whether it occured because I was following the instructions or doing something else.




            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created:

                Zendesk Support


                  Version Package