<commit_before>/*
 * Copyright (c) 2013-2014 LabKey Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.labkey.immport;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.data.Container;
import org.labkey.api.module.DefaultModule;
import org.labkey.api.module.ModuleContext;
import org.labkey.api.module.ModuleLoader;
import org.labkey.api.search.SearchService;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.services.ServiceRegistry;
import org.labkey.api.view.DefaultWebPartFactory;
import org.labkey.api.view.WebPartFactory;
import org.labkey.immport.security.ImmPortAdminRole;
import org.labkey.immport.view.StudyFinderWebPart;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;

public class ImmPortModule extends DefaultModule
{
    public static String NAME = "ImmPort";

    public static final SearchService.SearchCategory searchCategoryStudy = new SearchService.SearchCategory("immport_study", "ImmPort Study", false);


    @Override
    public String getName()
    {
        return NAME;
    }

    @Override
    public double getVersion()
    {
        return 15.00;
    }

    @Override
    public boolean hasScripts()
    {
        return true;
    }

    @NotNull
    @Override
    protected Collection<WebPartFactory> createWebPartFactories()
    {
        ArrayList<WebPartFactory> list = new ArrayList<>();
        list.add(new DefaultWebPartFactory("ImmPort Study Finder", StudyFinderWebPart.class, WebPartFactory.LOCATION_BODY));
        return list;
    }

    @Override
    protected void init()
    {
        addController("immport", ImmPortController.class);
        RoleManager.registerRole(new ImmPortAdminRole());
    }

    @Override
    public void doStartup(ModuleContext moduleContext)
    {
        ImmPortSchema.register(this);
        SearchService ss = ServiceRegistry.get().getService(SearchService.class);
        if (null != ss)
        {
            ss.addDocumentProvider(new ImmPortDocumentProvider());
            ss.addResourceResolver("immport",new ImmPortDocumentResolver());
            ss.addSearchCategory(ImmPortModule.searchCategoryStudy);
        }

        ModuleLoader.getInstance().registerFolderType(this, new ImmPortFolderType(this));
    }

    @NotNull
    @Override
    public Collection<String> getSummary(Container c)
    {
        return Collections.emptyList();
    }

    @Override
    @NotNull
    public Set<String> getSchemaNames()
    {
        return Collections.singleton("immport");
    }
}
<commit_msg>15.2 change -> FolderManager.get().registerFolderType()<commit_after>/*
 * Copyright (c) 2013-2014 LabKey Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.labkey.immport;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.data.Container;
import org.labkey.api.module.DefaultModule;
import org.labkey.api.module.ModuleContext;
import org.labkey.api.module.ModuleLoader;
import org.labkey.api.search.SearchService;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.services.ServiceRegistry;
import org.labkey.api.view.DefaultWebPartFactory;
import org.labkey.api.view.WebPartFactory;
import org.labkey.immport.security.ImmPortAdminRole;
import org.labkey.immport.view.StudyFinderWebPart;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;

public class ImmPortModule extends DefaultModule
{
    public static String NAME = "ImmPort";

    public static final SearchService.SearchCategory searchCategoryStudy = new SearchService.SearchCategory("immport_study", "ImmPort Study", false);


    @Override
    public String getName()
    {
        return NAME;
    }

    @Override
    public double getVersion()
    {
        return 15.00;
    }

    @Override
    public boolean hasScripts()
    {
        return true;
    }

    @NotNull
    @Override
    protected Collection<WebPartFactory> createWebPartFactories()
    {
        ArrayList<WebPartFactory> list = new ArrayList<>();
        list.add(new DefaultWebPartFactory("ImmPort Study Finder", StudyFinderWebPart.class, WebPartFactory.LOCATION_BODY));
        return list;
    }

    @Override
    protected void init()
    {
        addController("immport", ImmPortController.class);
        RoleManager.registerRole(new ImmPortAdminRole());
    }

    @Override
    public void doStartup(ModuleContext moduleContext)
    {
        ImmPortSchema.register(this);
        SearchService ss = ServiceRegistry.get().getService(SearchService.class);
        if (null != ss)
        {
            ss.addDocumentProvider(new ImmPortDocumentProvider());
            ss.addResourceResolver("immport",new ImmPortDocumentResolver());
            ss.addSearchCategory(ImmPortModule.searchCategoryStudy);
        }

//        ModuleLoader.getInstance().registerFolderType(this, new ImmPortFolderType(this));
    	FolderManager.get().registerFolderType(this, new ImmPortFolderType(this));
    }

    @NotNull
    @Override
    public Collection<String> getSummary(Container c)
    {
        return Collections.emptyList();
    }

    @Override
    @NotNull
    public Set<String> getSchemaNames()
    {
        return Collections.singleton("immport");
    }
}

{'fraction_non_alphanumeric': 0.09353312302839117, 'fraction_numerical': 0.005520504731861199, 'mean_word_length': 3.5099573257467993, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4223189', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1710, 'n_words': 437}