Package org.drools.repository

Examples of org.drools.repository.CategoryItem


    private boolean checkCategoryPermissionHelper(RepositoryFilter filter,
                                                  AssetItem item,
                                                  String roleType) {
        List<CategoryItem> tempCateList = item.getCategories();
        for ( Iterator<CategoryItem> i = tempCateList.iterator(); i.hasNext(); ) {
            CategoryItem categoryItem = i.next();

            if ( filter.accept( categoryItem.getName(),
                                roleType ) ) {
                return true;
            }
        }
View Full Code Here


        rulesRepository.loadDefaultModule();
        rulesRepository.createModule( "anotherPackage",
                                      "woot" );

        CategoryItem cat = rulesRepository.loadCategory( "/" );
        cat.addCategory( "testDeleteUnversioned",
                         "yeah" );

        String uuid = serviceImplementation.createNewRule( "test Delete Unversioned",
                                                           "a description",
                                                           "testDeleteUnversioned",
View Full Code Here

        rulesRepository.loadDefaultModule();
        rulesRepository.createModule( "another",
                                      "woot" );

        CategoryItem cat = rulesRepository.loadCategory( "/" );
        cat.addCategory( "testAddRule",
                         "yeah" );

        String result = serviceImplementation.createNewRule( "test AddRule",
                                                             "a description",
                                                             "testAddRule",
View Full Code Here

                      dtItem.getBinaryContentAsBytes().length );
    }

    @Test
    public void testAttemptDupeRule() throws Exception {
        CategoryItem cat = rulesRepository.loadCategory( "/" );
        cat.addCategory( "testAttemptDupeRule",
                         "yeah" );

        rulesRepository.createModule( "dupes",
                                      "yeah" );
View Full Code Here

    public void testRuleTableLoad() throws Exception {
        TableConfig conf = serviceImplementation.loadTableConfig( ExplorerNodeConfig.RULE_LIST_TABLE_ID );
        assertNotNull( conf.headers );
        assertNotNull( conf.headerTypes );

        CategoryItem cat = rulesRepository.loadCategory( "/" );
        cat.addCategory( "testRuleTableLoad",
                         "yeah" );

        rulesRepository.createModule( "testRuleTableLoad",
                                      "yeah" );
        serviceImplementation.createNewRule( "testRuleTableLoad",
View Full Code Here

    @Restrict("#{identity.loggedIn}")
    public String[] loadChildCategories(String categoryPath) {
        List<String> resultList = new ArrayList<String>();
        CategoryFilter filter = new CategoryFilter();

        CategoryItem item = repository.loadCategory( categoryPath );
        List children = item.getChildTags();
        for ( int i = 0; i < children.size(); i++ ) {
            String childCategoryName = ((CategoryItem) children.get( i )).getName();
            if ( filter.acceptNavigate( categoryPath,
                                        childCategoryName ) ) {
                resultList.add( childCategoryName );
View Full Code Here

        if ( path == null || "".equals( path ) ) {
            path = "/";
        }
        path = cleanHTML( path );

        CategoryItem item = repository.loadCategory( path );
        item.addCategory( name,
                          description );
        repository.save();
        return Boolean.TRUE;
    }
View Full Code Here

        meta.packageUUID = item.getPackage().getUUID();

        List cats = item.getCategories();
        meta.categories = new String[cats.size()];
        for ( int i = 0; i < meta.categories.length; i++ ) {
            CategoryItem cat = (CategoryItem) cats.get( i );
            meta.categories[i] = cat.getFullPath();
        }
        meta.dateEffective = calendarToDate( item.getDateEffective() );
        meta.dateExpired = calendarToDate( item.getDateExpired() );
        return meta;
View Full Code Here

    private boolean checkCategoryPermissionHelper(RepositoryFilter filter,
                                                  AssetItem item,
                                                  String roleType) {
        List<CategoryItem> tempCateList = item.getCategories();
        for ( Iterator<CategoryItem> i = tempCateList.iterator(); i.hasNext(); ) {
            CategoryItem categoryItem = i.next();

            if ( filter.accept( categoryItem.getName(),
                                roleType ) ) {
                return true;
            }
        }
View Full Code Here

    }

    private String findParentCategory(AssetItem asset,
                                      String currentCat) {
        //Start your search at the top
        CategoryItem item = asset.getRulesRepository().loadCategory( "/" );
        return findCategoryInChild( item,
                                    currentCat );
    }
View Full Code Here

TOP

Related Classes of org.drools.repository.CategoryItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.