Selects the given resource and sets its path into the xml-content field or editor link.<p>

@param resourcePath the resource path
@param structureId the structure id
@param title the resource title
@param resourceType the resource type
779232
public void selectResource(String resourcePath, CmsUUID structureId, String title, String resourceType) {

        String provider = getProviderName(resourceType);
        if (provider == null) {
            // use {@link org.opencms.ade.galleries.client.preview.CmsBinaryPreviewProvider} as default to select a resource
            provider = I_CmsBinaryPreviewProvider.PREVIEW_NAME;
        }
        if (m_previewFactoryRegistration.containsKey(provider)) {
            m_previewFactoryRegistration.get(provider).getPreview(m_handler.m_galleryDialog).selectResource(
                resourcePath,
                structureId,
                title);

        } else {
            CmsDebugLog.getInstance().printLine("No provider available");
        }
    }
1264892
public void setResourceTypes(List<String> resourceTypes) {

        if ((resourceTypes != null) && !resourceTypes.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_TYPE, resourceTypes, false, false);
        }
    }
845854
public void setResourceId(java.util.Collection<StringFilter> resourceId) {
        if (resourceId == null) {
            this.resourceId = null;
            return;
        }

        this.resourceId = new java.util.ArrayList<StringFilter>(resourceId);
    }
1160362
private CmsResource getResource(CmsUUID structureId) {

        CmsResource resource = m_resources.get(structureId);
        if (resource == null) {
            try {
                resource = m_cms.readResource(structureId, CmsResourceFilter.ALL);
                m_resources.put(structureId, resource);
            } catch (CmsException e) {
                LOG.info(e.getLocalizedMessage(), e);
            }
        }
        return resource;
    }
900008
public static void loadResource(final String serializerId,
      @SuppressWarnings("rawtypes") final Map<String, ArtifactSerializer> artifactSerializers,
      final String resourcePath, final Map<String, Object> resources) {

    final File resourceFile = new File(resourcePath);
    if (resourceFile != null) {
      final String resourceId = IOUtils
          .normalizeLexiconName(resourceFile.getName());
      final ArtifactSerializer<?> serializer = artifactSerializers
          .get(serializerId);
      final InputStream resourceIn = IOUtils.openFromFile(resourceFile);
      try {
        resources.put(resourceId, serializer.create(resourceIn));
      } catch (final InvalidFormatException e) {
        e.printStackTrace();
      } catch (final IOException e) {
        e.printStackTrace();
      } finally {
        try {
          resourceIn.close();
        } catch (final IOException e) {
        }
      }
    }
  }
789509
public static String getVaadinWorkplaceLink(CmsObject cms, CmsUUID structureId) {

        String resourceRootFolder = null;

        if (structureId != null) {
            try {
                resourceRootFolder = CmsResource.getFolderPath(
                    cms.readResource(structureId, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED).getRootPath());
            } catch (CmsException e) {
                LOG.debug("Error reading resource for workplace link.", e);
            }
        }
        if (resourceRootFolder == null) {
            resourceRootFolder = cms.getRequestContext().getSiteRoot();
        }
        return getVaadinWorkplaceLink(cms, resourceRootFolder);

    }
347771
public void setResourceId(String resourceId) {

        try {
            if (!m_resourceBuilder.isFolder()) {
                m_resourceBuilder.setResourceId(new CmsUUID(resourceId));
            } else {
                m_resourceBuilder.setResourceId(new CmsUUID());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
1250208
public void setResourceTypes(String[] resourceTypes) {

        if (resourceTypes != null) {
            m_parameters.setResourceTypes(Arrays.asList(resourceTypes));
        } else {
            m_parameters.setResourceTypes(null);
        }
        resetLastResult();
    }
685512
public static void setLink(String path, String title, String target) {

        nativeSetLink(path, CmsStringUtil.escapeHtml(title), target);
    }
821246
@com.fasterxml.jackson.annotation.JsonProperty("resourceId")
    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
349582
public static void openWorkplace(final CmsUUID structureId, final boolean classic) {

        CmsRpcAction<String> callback = new CmsRpcAction<String>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getService().getWorkplaceLink(structureId, this);
            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(String result) {

                stop(false);
                Window.Location.assign(result);
            }
        };
        callback.execute();
    }
180230
public void addType(String resourceType) {

        m_searchObject.addType(resourceType);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
1242230
@Override
	public void setLoadPath(final String loadPath) {
		if (loadPath == null) {
			LOG.warn("Use the default value because SQL template path is set to NULL.");
			LOG.warn("Default load path[{}]", DEFAULT_LOAD_PATH);
			this.loadPath = DEFAULT_LOAD_PATH;
		} else {
			this.loadPath = loadPath;
		}
	}
771132
@Override
    public void handleSelection(final CmsResourceTypeBean selectedType) {

        CmsObject cms = A_CmsUI.getCmsObject();
        m_selectedType = selectedType;
        try {

            CmsNewResourceBuilder builder = new CmsNewResourceBuilder(cms);
            builder.addCallback(new I_Callback() {

                public void onError(Exception e) {

                    m_dialogContext.error(e);
                }

                public void onResourceCreated(CmsNewResourceBuilder builderParam) {

                    finish(Lists.newArrayList(builderParam.getCreatedResource().getStructureId()));
                }
            });

            m_selectedType = selectedType;

            Boolean useDefaultLocation = m_defaultLocationCheckbox.getValue();
            if (useDefaultLocation.booleanValue() && (m_selectedType.getCreatePath() != null)) {
                try {
                    CmsADEConfigData configData = OpenCms.getADEManager().lookupConfiguration(
                        cms,
                        m_folderResource.getRootPath());

                    CmsResourceTypeConfig typeConfig = configData.getResourceType(m_selectedType.getType());
                    if (typeConfig != null) {
                        typeConfig.configureCreateNewElement(cms, m_folderResource.getRootPath(), builder);
                    }
                } catch (Exception e) {
                    m_dialogContext.error(e);
                }

            } else {
                boolean explorerNameGenerationMode = false;
                String sitePath = cms.getRequestContext().removeSiteRoot(m_folderResource.getRootPath());
                String namePattern = m_selectedType.getNamePattern();
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(namePattern)) {
                    namePattern = OpenCms.getWorkplaceManager().getDefaultNamePattern(m_selectedType.getType());
                    explorerNameGenerationMode = true;
                }
                String fileName = CmsStringUtil.joinPaths(sitePath, namePattern);
                builder.setPatternPath(fileName);
                builder.setType(m_selectedType.getType());
                builder.setExplorerNameGeneration(explorerNameGenerationMode);

            }
            CmsPropertyDialogExtension ext = new CmsPropertyDialogExtension(A_CmsUI.get(), null);
            CmsAppWorkplaceUi.get().disableGlobalShortcuts();
            ext.editPropertiesForNewResource(builder);
            finish(new ArrayList<CmsUUID>());

        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
119493
public static void checkContentResourceType(NodeType contentNodeType) throws NoSuchNodeTypeException
   {
      if (!contentNodeType.isNodeType(WebDavConst.NodeTypes.NT_RESOURCE))
      {
         throw new NoSuchNodeTypeException("Content-Node type " + contentNodeType.getName()
            + " must extend nt:resource.");
      }
   }
470668
@Override
	public String getFilePath(String resourcePath) {

		String filePath = null;
		String path = getCompletePath(resourcePath);
		URL url = null;
		try {
			url = ClassLoaderResourceUtils.getResourceURL(path, this);
			String strURL = url.toString();
			if (strURL.startsWith(JawrConstant.FILE_URL_PREFIX)) {
				filePath = new File(url.getFile()).getAbsolutePath();
			} else if (strURL.startsWith(JawrConstant.JAR_URL_PREFIX + JawrConstant.FILE_URL_PREFIX)) {
				String tmp = strURL.substring((JawrConstant.JAR_URL_PREFIX + JawrConstant.FILE_URL_PREFIX).length());
				int idxJarContentSeparator = tmp.indexOf("!");
				if (idxJarContentSeparator != -1) {
					tmp = tmp.substring(0, idxJarContentSeparator);
				}
				filePath = new File(tmp).getAbsolutePath();
			}
		} catch (ResourceNotFoundException e) {
			filePath = null;
		}

		return filePath;
	}
809893
public void setResourceType(java.util.Collection<StringFilter> resourceType) {
        if (resourceType == null) {
            this.resourceType = null;
            return;
        }

        this.resourceType = new java.util.ArrayList<StringFilter>(resourceType);
    }