Package org.drools.repository.UserInfo

Examples of org.drools.repository.UserInfo.InboxEntry


        int skipped = 0;
        Integer pageSize = pageRequest.getPageSize();
        int startRowIndex = pageRequest.getStartRowIndex();
        List<InboxPageRow> rowList = new ArrayList<InboxPageRow>();
        while ( iterator.hasNext() && (pageSize == null || rowList.size() < pageSize) ) {
            InboxEntry ie = (InboxEntry) iterator.next();

            if ( skipped >= startRowIndex ) {
                rowList.add( createInboxPageRow( ie,
                                                 pageRequest ) );
            }
View Full Code Here


                                                      userInfo.readEntries( INBOX,
                                                                            boxName ) );

        if ( entries.size() >= MAX_RECENT_EDITED ) {
            entries.remove( 0 );
            entries.add( new InboxEntry( assetId,
                                         note,
                                         userFrom ) );
        } else {
            entries.add( new InboxEntry( assetId,
                                         note,
                                         userFrom ) );
        }

        userInfo.writeEntries( INBOX,
View Full Code Here

    private List<InboxEntry> removeAnyExisting(String assetId,
                                               List<InboxEntry> inboxEntries) {
        Iterator<InboxEntry> it = inboxEntries.iterator();
        while ( it.hasNext() ) {
            InboxEntry e = it.next();
            if ( e.assetUUID.equals( assetId ) ) {
                it.remove();
                return inboxEntries;
            }
        }
View Full Code Here

        res.total = entries.size();
        res.hasNext = false;
        res.data = new TableDataRow[entries.size()];
        for ( int i = 0; i < entries.size(); i++ ) {
            TableDataRow tdr = new TableDataRow();
            InboxEntry e = entries.get( i );
            tdr.id = e.assetUUID;
            if ( !showFrom ) {
                tdr.values = new String[2];
                tdr.values[0] = e.note;
                tdr.values[1] = Long.toString( e.timestamp );
View Full Code Here

        repo.save();

        List<InboxEntry> entries = inb.loadRecentEdited();
        assertEquals(2, entries.size());

        InboxEntry e1 = entries.get(0);
        assertEquals("ABC", e1.assetUUID);
        assertEquals("This is a note", e1.note);

        InboxEntry e2 = entries.get(1);
        assertEquals("QED", e2.assetUUID);
        assertTrue(e2.timestamp > e1.timestamp);

        inb.clearAll();
View Full Code Here

        List<InboxEntry> res = inb.loadRecentOpened();
        assertEquals(120, res.size());
        inb.addToRecentOpened("XX", "hey");

        assertEquals(res.size() + 1, inb.loadRecentOpened().size());
        InboxEntry firstOld = inb.loadRecentOpened().get(0);
        assertEquals("A0", firstOld.assetUUID);


        Thread.sleep(30);
        //shouldn't add another one...
        inb.addToRecentOpened("A0", "hey22");

        List<InboxEntry> finalList = inb.loadRecentOpened();
        assertEquals(res.size() + 1, finalList.size());
        assertEquals("A1", finalList.get(0).assetUUID);

        InboxEntry lastEntry = finalList.get(finalList.size() - 1);
        assertEquals("A0", lastEntry.assetUUID);

        assertTrue(lastEntry.timestamp > firstOld.timestamp);
       
View Full Code Here

                                                      userInfo.readEntries( INBOX,
                                                                            boxName ) );

        if ( entries.size() >= MAX_RECENT_EDITED ) {
            entries.remove( 0 );
            entries.add( new InboxEntry( assetId,
                                         note,
                                         userFrom ) );
        } else {
            entries.add( new InboxEntry( assetId,
                                         note,
                                         userFrom ) );
        }

        userInfo.writeEntries( INBOX,
View Full Code Here

    private List<InboxEntry> removeAnyExisting(String assetId,
                                               List<InboxEntry> inboxEntries) {
        Iterator<InboxEntry> it = inboxEntries.iterator();
        while ( it.hasNext() ) {
            InboxEntry e = it.next();
            if ( e.assetUUID.equals( assetId ) ) {
                it.remove();
                return inboxEntries;
            }
        }
View Full Code Here

        res.total = entries.size();
        res.hasNext = false;
        res.data = new TableDataRow[entries.size()];
        for ( int i = 0; i < entries.size(); i++ ) {
            TableDataRow tdr = new TableDataRow();
            InboxEntry e = entries.get( i );
            tdr.id = e.assetUUID;
            if ( !showFrom ) {
                tdr.values = new String[2];
                tdr.values[0] = e.note;
                tdr.values[1] = Long.toString( e.timestamp );
View Full Code Here

        int skipped = 0;
        Integer pageSize = pageRequest.getPageSize();
        int startRowIndex = pageRequest.getStartRowIndex();
        List<InboxPageRow> rowList = new ArrayList<InboxPageRow>();
        while ( iterator.hasNext() && (pageSize == null || rowList.size() < pageSize) ) {
            InboxEntry ie = iterator.next();

            if ( skipped >= startRowIndex ) {
                rowList.add( createInboxPageRow( ie,
                                                 pageRequest ) );
            }
View Full Code Here

TOP

Related Classes of org.drools.repository.UserInfo.InboxEntry

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.