Add type to search object.<p>

@param resourceType the id(name?) of the resource type to add
180230
public void addType(String resourceType) {

        m_searchObject.addType(resourceType);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
663520
public void addAsset(Resource resource, ResourceType type) {
        /**
         * The code below (CSV/XLS) was added because of timelines related to switchyard/fuse.
         *  
         * However, it is an ugly hack: As soon as is possible, the code below should be removed or refactored. 
         * - an "addAsset(Resource, ResourceType, ResourceConfiguration)" method should be added to this implementation
         * - or the kbuilder code should be refactored so that there are two ResourceTypes: CSV and XLS
         * 
         * (refactoring the kbuilder code is probably a better idea.)
         */
        boolean replaced = false;
        if (resource.getSourcePath() != null ) { 
            String path = resource.getSourcePath();
          
            String typeStr = null;
            if( path.toLowerCase().endsWith(".csv") ) { 
                typeStr = DecisionTableInputType.CSV.toString();
            } else if( path.toLowerCase().endsWith(".xls") ) { 
                typeStr = DecisionTableInputType.XLS.toString();
            } 
           
            if( typeStr != null ) { 
                String worksheetName = null;
                boolean replaceConfig = true;
                ResourceConfiguration config = resource.getConfiguration();
                if( config != null && config instanceof DecisionTableConfiguration ) { 
                    DecisionTableInputType realType = DecisionTableInputType.valueOf(typeStr);
                    if( ((DecisionTableConfiguration) config).getInputType().equals(realType) ) { 
                       replaceConfig = false;
                    } else { 
                        worksheetName = ((DecisionTableConfiguration) config).getWorksheetName();
                    }
                }

                if( replaceConfig ) { 
                    Properties prop = new Properties();
                    prop.setProperty(ResourceTypeImpl.KIE_RESOURCE_CONF_CLASS, DecisionTableConfigurationImpl.class.getName());
                    prop.setProperty(DecisionTableConfigurationImpl.DROOLS_DT_TYPE, typeStr);
                    if( worksheetName != null ) { 
                        prop.setProperty(DecisionTableConfigurationImpl.DROOLS_DT_WORKSHEET, worksheetName);
                    }
                    ResourceConfiguration conf = ResourceTypeImpl.fromProperties(prop);
                    this.kbuilder.add(resource, type, conf);
                    replaced = true;
                }
            } 
        } 
        
        if( ! replaced ) { 
            this.kbuilder.add(resource, type);
        }

        if (this.kbuilder.hasErrors()) {
            StringBuffer errorMessage = new StringBuffer();
            for( KnowledgeBuilderError error : kbuilder.getErrors()) {
                errorMessage.append(error.getMessage() + ",");
            }
            this.kbuilder.undo();
            throw new IllegalArgumentException("Cannot add asset: " + errorMessage.toString());
        }
    }
900571
def add_resource(type, title, params = {})
      catalog.add_resource(new_resource(type, title, params))
    end
1339944
public void addSearchIndexSource(CmsSearchIndexSource searchIndexSource) {

        m_indexSources.put(searchIndexSource.getName(), searchIndexSource);

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_SEARCH_INDEX_SOURCE_2,
                    searchIndexSource.getName(),
                    searchIndexSource.getIndexerClassName()));
        }
    }
579813
public void sortTypes(String sortParams) {

        List<CmsResourceTypeBean> types = getSearchTypes();
        SortParams sort = SortParams.valueOf(sortParams);
        switch (sort) {
            case title_asc:
                Collections.sort(types, new CmsComparatorTitle(true));
                break;
            case title_desc:
                Collections.sort(types, new CmsComparatorTitle(false));
                break;
            case type_asc:
                Collections.sort(types, new CmsComparatorType(true));
                break;
            case type_desc:
                Collections.sort(types, new CmsComparatorType(false));
                break;
            case dateLastModified_asc:
            case dateLastModified_desc:
            case path_asc:
            case path_desc:
            case tree:
            default:
                // not supported
                return;
        }
        m_handler.onUpdateTypes(types, m_searchObject.getTypes());
    }
976910
public void removeType(String resourceType) {

        m_searchObject.removeType(resourceType);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
1344540
public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
    throws InjectionException
    {
        if (type instanceof String)
        {
            setInjectionClassTypeName((String) type);
        }
        else
        {
            Class<?> classType = (Class<?>) type;
            annotation.ivType = classType;
            annotation.ivIsSetType = true;
            setInjectionClassType(classType);
        }
    }
33541
private void setTypeRequested(ResourceType type) {
    synchronized (typeToFirstWait) {
      if (!typeToFirstWait.containsKey(type)) {
        typeToFirstWait.put(type, null);
      }
    }
  }
421084
public final void addResource(String path, HtmlResourceType type) {
		resources.add(new HtmlResource(path, type));
	}
87661
private synchronized void initResourceTypes() throws CmsConfigurationException {

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_STARTING_LOADER_CONFIG_0));
        }

        CmsResourceManagerConfiguration newConfiguration = new CmsResourceManagerConfiguration();

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_ADD_RESTYPE_FROM_FILE_2,
                    new Integer(m_resourceTypesFromXml.size()),
                    CmsVfsConfiguration.DEFAULT_XML_FILE_NAME));
        }

        // build a new resource type list from the resource types of the XML configuration
        Iterator<I_CmsResourceType> i;
        i = m_resourceTypesFromXml.iterator();
        while (i.hasNext()) {
            I_CmsResourceType resourceType = i.next();
            initResourceType(resourceType, newConfiguration);
        }

        // add all resource types declared in the modules
        CmsModuleManager moduleManager = OpenCms.getModuleManager();
        if (moduleManager != null) {
            Iterator<String> modules = moduleManager.getModuleNames().iterator();
            while (modules.hasNext()) {
                CmsModule module = moduleManager.getModule(modules.next());
                if ((module != null) && (module.getResourceTypes().size() > 0)) {
                    // module contains resource types
                    if (CmsLog.INIT.isInfoEnabled()) {
                        CmsLog.INIT.info(
                            Messages.get().getBundle().key(
                                Messages.INIT_ADD_NUM_RESTYPES_FROM_MOD_2,
                                new Integer(module.getResourceTypes().size()),
                                module.getName()));
                    }

                    Iterator<I_CmsResourceType> j = module.getResourceTypes().iterator();
                    while (j.hasNext()) {
                        I_CmsResourceType resourceType = j.next();
                        I_CmsResourceType conflictingType = null;
                        if (resourceType.getTypeId() == CmsResourceTypeUnknownFile.RESOURCE_TYPE_ID) {
                            // default unknown file resource type
                            if (m_restypeUnknownFile != null) {
                                // error: already set
                                conflictingType = m_restypeUnknownFile;
                            } else {
                                m_restypeUnknownFile = resourceType;
                                continue;
                            }
                        } else if (resourceType.getTypeId() == CmsResourceTypeUnknownFolder.RESOURCE_TYPE_ID) {
                            // default unknown folder resource type
                            if (m_restypeUnknownFolder != null) {
                                // error: already set
                                conflictingType = m_restypeUnknownFolder;
                            } else {
                                m_restypeUnknownFile = resourceType;
                                continue;
                            }
                        } else {
                            // normal resource types
                            conflictingType = newConfiguration.getResourceTypeById(resourceType.getTypeId());
                        }
                        if (conflictingType != null) {
                            throw new CmsConfigurationException(
                                Messages.get().container(
                                    Messages.ERR_CONFLICTING_MODULE_RESOURCE_TYPES_5,
                                    new Object[] {
                                        resourceType.getTypeName(),
                                        new Integer(resourceType.getTypeId()),
                                        module.getName(),
                                        conflictingType.getTypeName(),
                                        new Integer(conflictingType.getTypeId())}));
                        }
                        initResourceType(resourceType, newConfiguration);
                    }
                }
            }
        }

        // freeze the current configuration
        newConfiguration.freeze(m_restypeUnknownFile, m_restypeUnknownFile);
        m_configuration = newConfiguration;
        m_frozen = true;

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_RESOURCE_TYPE_INITIALIZED_0));
        }
    }
249784
public void addEventType(String eventType)
    {
        if(this.eventTypes == null)
            this.eventTypes = new ArrayList<String>();
        this.eventTypes.add(eventType);
    }
632080
protected void addPendingRequestForType(ResourceRequestInfo req) {
    Context c = getContext(req.getType());
    c.pendingRequests.add(req);
    c.pendingRequestCount++;
  }
630212
public List<CmsResourceTypeBean> getSearchTypes() {

        if (m_searchTypes != null) {
            return m_searchTypes;
        }
        m_searchTypes = Lists.newArrayList();
        for (CmsResourceTypeBean type : m_dialogBean.getTypes()) {
            if (type.getVisibility() != TypeVisibility.hidden) {
                m_searchTypes.add(type);
            }
        }
        return m_searchTypes;
    }
1264892
public void setResourceTypes(List<String> resourceTypes) {

        if ((resourceTypes != null) && !resourceTypes.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_TYPE, resourceTypes, false, false);
        }
    }
1183969
public static List<Resource> getChildrenByResourceType(final Resource resource, String resourceType) {
        final ArrayList<Resource> children = new ArrayList<>();
        if (resource != null) {
            for (final Resource child : resource.getChildren()) {
                if (child.isResourceType(resourceType)) {
                    children.add(child);
                }
            }
        }
        return children;
    }
777298
public void addProjectResource(String resourceName) {

        if ((m_throwable != null) || (m_projectName == null)) {
            return;
        }
        if (m_projectResources == null) {
            m_projectResources = new ArrayList<String>();
        }
        m_projectResources.add(resourceName);
    }
985325
public void selectResource(String resourcePath, CmsUUID structureId, String title, String resourceType) {

        m_controller.selectResource(resourcePath, structureId, title, resourceType);
    }