Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.QueryPageRequest


    protected void loadShortList( String searchText,
                                  Boolean searchArchived,
                                  Boolean isCaseSensitive,
                                  final Request r,
                                  final Callback cb ) {
        final QueryPageRequest queryRequest = new QueryPageRequest( searchText,
                searchArchived,
                isCaseSensitive,
                0,
                5 );
        RepositoryServiceFactory.getAssetService().quickFindAsset( queryRequest,
View Full Code Here


                clientFactory );
        this.clientFactory = clientFactory;

        setDataProvider( new AsyncDataProvider<QueryPageRow>() {
            protected void onRangeChanged(HasData<QueryPageRow> display) {
                QueryPageRequest request = new QueryPageRequest();
                request.setSearchText( searchText );
                request.setSearchArchived( searchArchived );
                request.setStartRowIndex( pager.getPageStart() );
                request.setPageSize( pageSize );
                repositoryService.queryFullText( request,
                                                 new GenericCallback<PageResponse<QueryPageRow>>() {
                                                     public void onSuccess(PageResponse<QueryPageRow> response) {
                                                         updateRowCount( response.getTotalRowSize(),
                                                                         response.isTotalRowSizeExact() );
View Full Code Here

                clientFactory );
        this.clientFactory = clientFactory;

        setDataProvider( new AsyncDataProvider<QueryPageRow>() {
            protected void onRangeChanged(HasData<QueryPageRow> display) {
                QueryPageRequest request = new QueryPageRequest();
                request.setSearchText( searchText );
                request.setSearchArchived( searchArchived );
                request.setIsCaseSensitive( isCaseSensitive );
                request.setStartRowIndex( pager.getPageStart() );
                request.setPageSize( pageSize );
                assetService.quickFindAsset( request,
                                                  new GenericCallback<PageResponse<QueryPageRow>>() {
                                                      public void onSuccess(PageResponse<QueryPageRow> response) {
                                                          updateRowCount( response.getTotalRowSize(),
                                                                          response.isTotalRowSizeExact() );
View Full Code Here

    @Test
    @Ignore("To be fixed: GUVNOR-296")
    public void testHistoryAfterReImportSampleRepository() throws Exception {

        QueryPageRequest request;
        PageResponse<QueryPageRow> response;
        //Import sample, do a sanity check, make sure sample is installed correctly
        repositoryPackageService.installSampleRepository();
        Module[] cfgs = repositoryPackageService.listModules();
        assertEquals( 2,
                      cfgs.length );
        assertTrue( cfgs[0].getName().equals( "mortgages" ) || cfgs[1].getName().equals( "mortgages" ) );

        request = new QueryPageRequest( "Bankruptcy history",
                                        false,
                                        0,
                                        20 );

        response = repositoryAssetService.quickFindAsset( request );
        assertEquals( 1,
                      response.getPageRowList().size() );
        String uuid = response.getPageRowList().get( 0 ).getUuid();

        // create version 4.
        Asset ai = repositoryAssetService.loadRuleAsset( uuid );
        ai.setCheckinComment( "version 4" );
        repositoryAssetService.checkinVersion( ai );

        // create version 5.
        ai = repositoryAssetService.loadRuleAsset( uuid );
        ai.setCheckinComment( "version 5" );
        repositoryAssetService.checkinVersion( ai );

        System.out.println( "old uuid: " + uuid );

        //NOTE: Have not figured out the reason, but if we dont create a random package here,
        //we will get an InvalidItemStateException during impl.installSampleRepository()
        rulesRepository.createModule( "testHistoryAfterReImportSampleRepository",
                                      "desc" );

        TableDataResult result = repositoryAssetService.loadItemHistory( uuid );
        assertNotNull( result );
        TableDataRow[] rows = result.data;
        assertEquals( 2,
                      rows.length );

        //Import sample again
        repositoryPackageService.installSampleRepository();

        request = new QueryPageRequest( "Bankruptcy history",
                                        false,
                                        0,
                                        20 );
        response = repositoryAssetService.quickFindAsset( request );
        assertEquals( 1,
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule*",
                                                         false,
                                                         0,
                                                         PAGE_SIZE );
        PageResponse<QueryPageRow> response;
        response = impl.queryFullText( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( 0,
                      response.getStartRowIndex() );
        assertEquals( PAGE_SIZE,
                      response.getPageRowList().size() );
        assertFalse( response.isLastPage() );

        request.setStartRowIndex( PAGE_SIZE );
        response = impl.queryFullText( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( PAGE_SIZE,
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule*",
                                                         false,
                                                         0,
                                                         null );
        PageResponse<QueryPageRow> response;
        response = impl.queryFullText( request );
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule*",
                                                         false,
                                                         0,
                                                         PAGE_SIZE );
        PageResponse<QueryPageRow> response;
        RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
        response = repositoryAssetService.quickFindAsset( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( 0,
                      response.getStartRowIndex() );
        assertEquals( PAGE_SIZE,
                      response.getPageRowList().size() );
        assertFalse( response.isLastPage() );

        request.setStartRowIndex( PAGE_SIZE );
        response = impl.queryFullText( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( PAGE_SIZE,
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule*",
                                                         false,
                                                         0,
                                                         null );
        PageResponse<QueryPageRow> response;
        RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule",
                                                         false,
                                                         false,
                                                         0,
                                                         null );
        PageResponse<QueryPageRow> response;
View Full Code Here

                            "desc",
                            cat,
                            "testTextSearch",
                            AssetFormats.DRL );

        QueryPageRequest request = new QueryPageRequest( "testTextRule",
                                                         false,
                                                         false,
                                                         0,
                                                         PAGE_SIZE );
        PageResponse<QueryPageRow> response;
        RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
        response = repositoryAssetService.quickFindAsset( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( 0,
                      response.getStartRowIndex() );
        assertEquals( PAGE_SIZE,
                      response.getPageRowList().size() );
        assertFalse( response.isLastPage() );

        request.setStartRowIndex( PAGE_SIZE );
        response = impl.queryFullText( request );

        assertNotNull( response );
        assertNotNull( response.getPageRowList() );
        assertEquals( PAGE_SIZE,
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.QueryPageRequest

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.