Sets the needed properties from the {@link #ARGS_PROPERTY_DEFINITION} property of the given resource.<p>

@param cms the cms context
@param resourcePath the path to the resource to read the property from
497500
protected void setParameters(CmsObject cms, String resourcePath) {

        try {
            CmsProperty prop = cms.readPropertyObject(resourcePath, ARGS_PROPERTY_DEFINITION, false);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(prop.getValue())) {
                Map<String, String> argsMap = new HashMap<String, String>();
                Iterator<String> itArgs = CmsStringUtil.splitAsList(prop.getValue(), ARGUMENT_SEPARATOR).iterator();
                while (itArgs.hasNext()) {
                    String arg = "";
                    try {
                        arg = itArgs.next();
                        int pos = arg.indexOf(VALUE_SEPARATOR);
                        argsMap.put(arg.substring(0, pos), arg.substring(pos + 1));
                    } catch (StringIndexOutOfBoundsException e) {
                        LOG.error("sep: " + VALUE_SEPARATOR + "arg: " + arg);
                        throw e;
                    }
                }
                if (argsMap.get(ARG_PATH_NAME) != null) {
                    setPath(argsMap.get(ARG_PATH_NAME));
                }
                if (argsMap.get(ARG_CONFIRMATION_NAME) != null) {
                    setConfirmationMessage(argsMap.get(ARG_CONFIRMATION_NAME));
                }
                if (argsMap.get(ARG_PARAM_NAME) != null) {
                    setParameterString(argsMap.get(ARG_PARAM_NAME));
                }
            }
        } catch (CmsException e) {
            // should never happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
    }
1264892
public void setResourceTypes(List<String> resourceTypes) {

        if ((resourceTypes != null) && !resourceTypes.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_TYPE, resourceTypes, false, false);
        }
    }
1193807
public void editResourcePath(CmsAliasTableRow row, String path) {

        row.setEdited(true);
        row.editResourcePath(path);
        validate();
    }
430570
public void setWorkPath(String workPath) throws CmsIllegalArgumentException {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(workPath)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.GUI_ERR_WIDGETVALUE_EMPTY_0));
        }
        // test if it is a valid path:
        if (!m_cms.existsResource(workPath)) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(Messages.GUI_ERR_TAGREPLACE_WORKPATH_1, workPath));
        }
        m_workPath = workPath;

    }
754930
protected function setResourceMembers($resourcePath = null)
    {
        // remove trailing slash here, override this function if you need it
        $this->resourcePath = rtrim($resourcePath, '/');
        $this->resourceArray = (!empty($this->resourcePath)) ? explode('/', $this->resourcePath) : [];

        if (!empty($this->resourceArray)) {
            $resource = array_get($this->resourceArray, 0);
            if (!is_null($resource) && ('' !== $resource)) {
                $this->resource = $resource;
            }
            $id = array_get($this->resourceArray, 1);
            if (!is_null($id) && ('' !== $id)) {
                $this->resourceId = $id;
            }
        }

        return $this;
    }
108612
public void moveTo(String cmsNewPath) throws CmsException {

        ensureLock();
        m_cms.moveResource(m_cms.getSitePath(m_resource), cmsNewPath);
        CmsUUID id = m_resource.getStructureId();
        CmsResource updatedRes = m_cms.readResource(id, CmsJlanDiskInterface.STANDARD_FILTER);
        m_resource = updatedRes;
        updateFromResource();
    }
92926
private void setParameterValue(CmsObject cms, String key, String value) {

        if (m_parameters == null) {
            m_parameters = getParameterMap(getStringValue(cms));
        }
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(value) && m_parameters.containsKey(key)) {
            m_parameters.remove(key);
        } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) {
            m_parameters.put(key, new String[] {value});
        }
        String result = CmsRequestUtil.getRequestLink(getStringValue(cms));
        result = CmsRequestUtil.appendParameters(result, m_parameters, false);
        setStringValue(cms, result);
    }
1239823
public void setExportPath(String exportPath) {

        if (exportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) {
            // not allowed because a full static export would delete the opencms directory
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name));
        }
        m_exportPath = exportPath;
    }
852803
protected void addResource(String path) {

        CmsPathSelectField field = new CmsPathSelectField();
        field.setCmsObject(m_cms);
        field.setUseRootPaths(true);
        field.setValue(path);
        field.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 8646438704383992571L;

            public void valueChange(ValueChangeEvent event) {

                setOkButtonEnabled(true);

            }
        });
        m_componentsToValidate.add(field);
        CmsRemovableFormRow<CmsPathSelectField> row = new CmsRemovableFormRow<CmsPathSelectField>(
            field,
            CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_SYNC_REMOVE_RESOURCE_0));
        row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_SYNC_RESOURCE_0));
        row.setRemoveRunnable(new Runnable() {

            public void run() {

                setOkButtonEnabled(true);
            }
        });
        m_resources.addComponent(row);
    }
567049
public void setDescription(CmsObject cms, String description) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) {
            m_description = "";
            if (m_element.element(PARAM_DESCRIPTION) != null) {
                m_element.remove(m_element.element(PARAM_DESCRIPTION));
            }
        } else {
            m_description = description;
            description = CmsEncoder.escapeWBlanks(description, CmsEncoder.ENCODING_UTF_8);
        }
        setParameterValue(cms, PARAM_DESCRIPTION, description);
    }
142983
private static Properties loadWithNormalMode(final String propertyFilePath)
            throws Exception {

        Properties props = new Properties();
        props.load(new InputStreamReader(new FileInputStream(propertyFilePath), "utf-8"));
        return props;
    }
1333917
private void getImageInfo(final String resourcePath, final I_CmsSimpleCallback<CmsImageInfoBean> callback) {

        CmsRpcAction<CmsImageInfoBean> action = new CmsRpcAction<CmsImageInfoBean>() {

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

                start(0, true);
                A_CmsResourcePreview.getService().getImageInfo(resourcePath, getLocale(), this);

            }

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

                stop(false);
                callback.execute(result);
            }
        };
        action.execute();
    }
446235
public static Action resourceContent(String resourcePath, String charset) {
        URL resource = Action.class.getClassLoader().getResource(resourcePath);
        if (resource == null) {
            throw new IllegalArgumentException(String.format("Resource %s not found.", resourcePath));
        }
        Action charsetAction = charset == null ? noop() : charset(Charset.forName(charset));
        return composite(resourceContent(resource), charsetAction);
    }
168320
public void touchResource(String resourcePath) throws Exception {

        CmsResource resource = m_cms.readResource(resourcePath);
        CmsLockActionRecord action = CmsLockUtil.ensureLock(m_cms, resource);
        try {
            OpenCms.getWorkplaceManager().flushMessageCache();
            // One important reason for touching resources via the shell is to write mapped values containing
            // localization macros to properties, so we flush the workplace messages immediately before the touch operation
            // in case an older version of the workplace messages (not containing the keys we need) has already been cached
            touchSingleResource(m_cms, resourcePath, System.currentTimeMillis(), true, true, true);
        } finally {
            if (action.getChange() == LockChange.locked) {
                m_cms.unlockResource(resource);
            }
        }
    }
1369101
public void loadResourceInfo(final String resourcePath) {

        CmsRpcAction<CmsResourceInfoBean> action = new CmsRpcAction<CmsResourceInfoBean>() {

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

                getService().getResourceInfo(resourcePath, getLocale(), this);
            }

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

                showData(result);
            }
        };
        action.execute();
    }
888695
@Override
   public void setPropertyPath(PropertyPath<TypeDescriptor<TypeMetadata>> propertyPath) {
      if (aggregationFunction != null) {
         if (propertyPath == null && aggregationFunction != AggregationFunction.COUNT && aggregationFunction != AggregationFunction.COUNT_DISTINCT) {
            throw log.getAggregationCanOnlyBeAppliedToPropertyReferencesException(aggregationFunction.name());
         }
         propertyPath = new AggregationPropertyPath<>(aggregationFunction, propertyPath.getNodes());
      }
      if (phase == Phase.SELECT) {
         if (projections == null) {
            projections = new ArrayList<>(ARRAY_INITIAL_LENGTH);
            projectedTypes = new ArrayList<>(ARRAY_INITIAL_LENGTH);
            projectedNullMarkers = new ArrayList<>(ARRAY_INITIAL_LENGTH);
         }
         PropertyPath<TypeDescriptor<TypeMetadata>> projection;
         Class<?> propertyType;
         Object nullMarker;
         if (propertyPath.getLength() == 1 && propertyPath.isAlias()) {
            projection = new PropertyPath<>(Collections.singletonList(new PropertyPath.PropertyReference<>("__HSearch_This", null, true))); //todo [anistor] this is a leftover from hsearch ????   this represents the entity itself. see org.hibernate.search.ProjectionConstants
            propertyType = null;
            nullMarker = null;
         } else {
            projection = resolveAlias(propertyPath);
            propertyType = propertyHelper.getPrimitivePropertyType(targetEntityMetadata, projection.asArrayPath());
            nullMarker = fieldIndexingMetadata.getNullMarker(projection.asArrayPath());
         }
         projections.add(projection);
         projectedTypes.add(propertyType);
         projectedNullMarkers.add(nullMarker);
      } else {
         this.propertyPath = propertyPath;
      }
   }
501952
private void getInitialCroppingParameter(
        final String resourcePath,
        final I_CmsSimpleCallback<CmsCroppingParamBean> callback) {

        getImageInfo(resourcePath, new I_CmsSimpleCallback<CmsImageInfoBean>() {

            public void execute(CmsImageInfoBean imageInfo) {

                CmsImageFormatHandler formatHandler = new CmsImageFormatHandler(
                    getGalleryMode(),
                    getGalleryDialog(),
                    resourcePath,
                    imageInfo.getHeight(),
                    imageInfo.getWidth());
                CmsCroppingParamBean param = formatHandler.getCroppingParam();
                if (formatHandler.isUseFormats()) {
                    formatHandler.getFormats().values().iterator().next().adjustCroppingParam(param);
                }
                callback.execute(param);
            }
        });

    }