Creates a new gallery dialog.<p>

@param galleryHandler the gallery handler
@param data the gallery data

@return the gallery dialog instance
972119
@SuppressWarnings("unused")
    public static CmsGalleryDialog createDialog(I_CmsGalleryHandler galleryHandler, CmsGalleryDataBean data) {

        CmsGalleryDialog galleryDialog = new CmsGalleryDialog(galleryHandler);
        new CmsGalleryController(new CmsGalleryControllerHandler(galleryDialog), data, null);
        return galleryDialog;
    }
682303
protected CmsTreeItem createTreeItem(
        CmsGalleryFolderBean galleryInfo,
        List<String> selectedGalleries,
        boolean forTree) {

        CmsListItemWidget listItemWidget = new CmsListItemWidget(galleryInfo);
        listItemWidget.setUnselectable();
        CmsCheckBox checkBox = new CmsCheckBox();
        SelectionHandler selectionHandler = new SelectionHandler(galleryInfo.getPath(), checkBox);
        checkBox.addClickHandler(selectionHandler);
        listItemWidget.addClickHandler(selectionHandler);
        if ((selectedGalleries != null) && selectedGalleries.contains(galleryInfo.getPath())) {
            checkBox.setChecked(true);
        }

        if (galleryInfo.isEditable()) {
            if (CmsEditExternalLinkDialog.LINK_GALLERY_RESOURCE_TYPE_NAME.equals(galleryInfo.getType())) {
                CmsPushButton createExternalLink = createNewExternalLinkButton(galleryInfo.getPath());
                if (createExternalLink != null) {
                    listItemWidget.addButton(createExternalLink);
                }
            } else {
                listItemWidget.addButton(createUploadButtonForTarget(galleryInfo.getPath(), false));
            }
        }
        listItemWidget.addButton(createSelectButton(selectionHandler));
        if (m_tabHandler.hasGalleriesSelectable()) {
            CmsPushButton selectButton = createSelectResourceButton(
                galleryInfo.getPath(),
                CmsUUID.getNullUUID(),
                "",
                "");
            listItemWidget.addButton(selectButton);
        }

        CmsTreeItem treeItem = new CmsTreeItem(forTree, checkBox, listItemWidget);
        treeItem.setId(galleryInfo.getPath());
        return treeItem;
    }
1305473
def CreateGallery():
    
    url = 'http://min.us/api/CreateGallery'

    response = _dopost(url)

    _editor_id = response["editor_id"]
    _reader_id = response["reader_id"]

    return Gallery(_reader_id, editor_id=_editor_id)
188172
public static UniversalIdIntQueueMessage newInstance(Map<String, Object> data) {
        UniversalIdIntQueueMessage msg = newInstance();
        return msg.fromMap(data);
    }
51981
public static UniversalIdStrQueueMessage newInstance(Map<String, Object> data) {
        UniversalIdStrQueueMessage msg = newInstance();
        return msg.fromMap(data);
    }
1117531
@Override
    public IQueueMessage<ID, DATA> createMessage(DATA content) {
        return messageFactory.createMessage(content);
    }
465740
protected CmsFormRow createRow(String labelText, String description, Widget widget) {

        return createRow(labelText, description, widget, null, false);
    }
519671
protected I_CmsGalleryServiceAsync getGalleryService() {

        if (m_gallerySvc == null) {
            m_gallerySvc = GWT.create(I_CmsGalleryService.class);
            String serviceUrl = CmsCoreProvider.get().link("org.opencms.ade.galleries.CmsGalleryService.gwt");
            ((ServiceDefTarget)m_gallerySvc).setServiceEntryPoint(serviceUrl);
        }
        return m_gallerySvc;
    }
668749
protected void openDialog() {

        CmsCreateGalleryDialog dialog = new CmsCreateGalleryDialog(
            m_hoverbar.getController(),
            m_resourceTypeId,
            m_parentId);
        dialog.center();
    }
338649
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public MessageEvent createMessageEvent(Data data) {
    return MessageEvent.builder(MessageEvent.Type.SENT, MESSAGE_ID).build();
  }
252945
public function submitToGallery($imageOrAlbumId, $data)
    {
        if (!isset($data['title'])) {
            throw new MissingArgumentException('title');
        }

        return $this->post('gallery/' . $imageOrAlbumId, $data);
    }
284273
protected void showGallery(CmsClientSitemapEntry entry) {

        CmsGalleryConfiguration configuration = new CmsGalleryConfiguration();
        List<String> typeNames = CmsSitemapView.getInstance().getController().getGalleryType(
            new Integer(entry.getResourceTypeId())).getContentTypeNames();
        configuration.setSearchTypes(typeNames);
        configuration.setResourceTypes(typeNames);
        configuration.setGalleryMode(GalleryMode.adeView);
        configuration.setGalleryStoragePrefix("" + GalleryMode.adeView);
        configuration.setTabConfiguration(CmsGalleryTabConfiguration.resolve("selectDoc"));
        configuration.setReferencePath(getSitePath());
        configuration.setGalleryPath(getSitePath());
        CmsGalleryPopup dialog = new CmsGalleryPopup(null, configuration);
        dialog.center();
    }
1336285
public void displayNewGallery(CmsGalleryFolderEntry galleryFolder) {

        String parent = CmsResource.getParentFolder(galleryFolder.getSitePath());
        CmsSitemapTreeItem parentItem = getTreeItem(parent);
        if (parentItem != null) {
            CmsUUID parentId = parentItem.getEntryId();
            m_controller.updateEntry(parentId);
        } else {
            m_controller.loadPath(parent);
        }
        CmsGalleryTreeItem typeItem = m_galleryTypeItems.get(galleryFolder.getResourceType());
        CmsGalleryTreeItem folderItem = createGalleryFolderItem(galleryFolder);
        if ((parentItem != null) && m_galleryTreeItems.containsKey(parentItem.getEntryId())) {
            CmsGalleryTreeItem galleryParent = m_galleryTreeItems.get(parentItem.getEntryId());
            galleryParent.addChild(folderItem);
            galleryParent.setOpen(true);
        } else {
            typeItem.addChild(folderItem);
        }
        m_galleryTreeItems.put(galleryFolder.getStructureId(), folderItem);
        typeItem.setOpen(true);
        // in case the type item had been hidden
        typeItem.getElement().getStyle().clearDisplay();
        m_noGalleriesLabel.getElement().getStyle().setDisplay(Display.NONE);
    }
598442
public static <S extends HasAttachHandlers> boolean fire(S source, GroupRowData data) {
        if (TYPE != null) {
            JQMDataTableGroupRowEvent event = new JQMDataTableGroupRowEvent(data);
            source.fireEvent(event);
            return event.isStopDfltClick();
        }
        return false;
    }
1245406
@SuppressWarnings("unchecked")
	public T create(Map<String, Object> data)
	{
		Object[] args = new Object[arguments.length];
		for(int i=0, n=args.length; i<n; i++)
		{
			args[i] = arguments[i].getValue(data);
		}

		try
		{
			return (T) raw.newInstance(args);
		}
		catch(IllegalArgumentException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InstantiationException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(IllegalAccessException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InvocationTargetException e)
		{
			throw new SerializationException("Unable to create; " + e.getCause().getMessage(), e.getCause());
		}
	}
303379
public static Map<String, List<Interaction>> getConnectionListenerData(List<Interaction> data)
   {
      Map<String, List<Interaction>> result = new TreeMap<String, List<Interaction>>();

      for (int i = 0; i < data.size(); i++)
      {
         Interaction interaction = data.get(i);

         List<Interaction> l = result.get(interaction.getConnectionListener());

         if (l == null)
            l = new ArrayList<Interaction>();

         l.add(interaction);

         result.put(interaction.getConnectionListener(), l);
      }

      return result;
   }
67042
public String buildSelectStartGalleries(String htmlAttributes) {

        StringBuffer result = new StringBuffer(1024);
        HttpServletRequest request = getJsp().getRequest();
        // set the attributes for the select tag
        if (htmlAttributes != null) {
            htmlAttributes += " name=\"" + PARAM_STARTGALLERY_PREFIX;
        }
        Map<String, A_CmsAjaxGallery> galleriesTypes = OpenCms.getWorkplaceManager().getGalleries();
        if (galleriesTypes != null) {

            // sort the galleries by localized name
            Map<String, String> localizedGalleries = new TreeMap<String, String>();
            for (Iterator<String> i = galleriesTypes.keySet().iterator(); i.hasNext();) {
                String currentGalleryType = i.next();
                String localizedName = CmsWorkplaceMessages.getResourceTypeName(this, currentGalleryType);
                localizedGalleries.put(localizedName, currentGalleryType);
            }

            for (Iterator<Map.Entry<String, String>> i = localizedGalleries.entrySet().iterator(); i.hasNext();) {
                Map.Entry<String, String> entry = i.next();
                // first: retrieve the gallery type
                String currentGalleryType = entry.getValue();
                // second: retrieve the gallery type id
                int currentGalleryTypeId = 0;
                try {
                    currentGalleryTypeId = OpenCms.getResourceManager().getResourceType(currentGalleryType).getTypeId();
                } catch (CmsLoaderException e) {
                    // resource type not found, log error
                    if (LOG.isErrorEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                    continue;
                }
                // third: get the available galleries for this gallery type id
                List<CmsResource> availableGalleries = A_CmsAjaxGallery.getGalleries(currentGalleryTypeId, getCms());

                // forth: fill the select box
                List<String> options = new ArrayList<String>(availableGalleries.size() + 2);
                List<String> values = new ArrayList<String>(availableGalleries.size() + 2);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_PRESELECT_0));
                values.add(INPUT_DEFAULT);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_NONE_0));
                values.add(INPUT_NONE);

                String savedValue = computeStartGalleryPreselection(request, currentGalleryType);
                int counter = 2;
                int selectedIndex = 0;
                Iterator<CmsResource> iGalleries = availableGalleries.iterator();
                while (iGalleries.hasNext()) {
                    CmsResource res = iGalleries.next();
                    String rootPath = res.getRootPath();
                    String sitePath = getCms().getSitePath(res);
                    // select the value
                    if ((savedValue != null) && (savedValue.equals(rootPath))) {
                        selectedIndex = counter;
                    }
                    counter++;
                    // gallery title
                    String title = "";
                    try {
                        // read the gallery title
                        title = getCms().readPropertyObject(
                            sitePath,
                            CmsPropertyDefinition.PROPERTY_TITLE,
                            false).getValue("");
                    } catch (CmsException e) {
                        // error reading title property
                        if (LOG.isErrorEnabled()) {
                            LOG.error(e.getLocalizedMessage(), e);
                        }
                    }
                    options.add(title.concat(" (").concat(sitePath).concat(")"));
                    values.add(rootPath);

                }
                // select the value
                if ((savedValue != null) && savedValue.equals(INPUT_NONE)) {
                    selectedIndex = 1;
                }

                // create the table row for the current resource type
                result.append("<tr>\n\t<td style=\"white-space: nowrap;\">");

                result.append(entry.getKey());
                result.append("</td>\n\t<td>");
                result.append(buildSelect(htmlAttributes + currentGalleryType + "\"", options, values, selectedIndex));
                result.append("</td>\n</tr>\n");

            }

        }
        return result.toString();
    }