code: public void openGallery() throws Exception {
  
          String galleryPath = getParamResource();
          if ((galleryPath != null) && !galleryPath.endsWith("/")) {
              galleryPath += "/";
          }
          Map<String, String[]> params = new HashMap<String, String[]>();
          Locale locale = OpenCms.getLocaleManager().getDefaultLocale(getCms(), galleryPath);
          params.put("__locale", new String[] {locale.toString()});
          params.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_MODE, new String[] {GalleryMode.view.name()});
          try {
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(galleryPath)) {
                  // ensure to have a proper site path to the gallery folder, this is needed within the shared site
                  CmsResource galleryFolder = getCms().readResource(galleryPath);
                  galleryPath = getCms().getSitePath(galleryFolder);
              }
          } catch (CmsException e) {
              // nothing to do
          }
          params.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_PATH, new String[] {galleryPath});
          params.put(I_CmsGalleryProviderConstants.CONFIG_RESOURCE_TYPES, new String[] {""});
          sendForward(I_CmsGalleryProviderConstants.VFS_OPEN_GALLERY_PATH, params);
      }
docs: Opens the gallery.<p>
  
  @throws Exception if something goes wrong