Package uk.gov.nationalarchives.droid.profile

Examples of uk.gov.nationalarchives.droid.profile.ProfileInstanceManager


                    final String message = String.format(PROJECT_NOT_AVAILABLE_FOR_EXPORT, profileId);
                    log.warn(message);
                    throw new RuntimeException(message);
                }
                ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
                ProfileInstanceManager profileContext = profileContextLocator.openProfileInstanceManager(profile);
                ItemReader<ProfileResourceNode> reader = profileContext.getNodeItemReader();
                ItemReaderCallback<ProfileResourceNode> callback = new ItemReaderCallback<ProfileResourceNode>() {
                    @Override
                    public void onItem(List<? extends ProfileResourceNode> itemChunk)
                        throws JobCancellationException {
                        itemWriter.write(itemChunk);
View Full Code Here


    }

    @Test
    public void testExportNodesToCsv() throws Exception {
       
        ProfileInstanceManager profileInstanceManager = mock(ProfileInstanceManager.class);
        ProfileInstance profile1 = mock(ProfileInstance.class);
       
        when(profileContextLocator.getProfileInstance("profile1")).thenReturn(profile1);
        when(profileContextLocator.hasProfileContext(anyString())).thenReturn(true);
        when(profileInstanceManager.getNodeItemReader()).thenReturn(reader);
        when(profileContextLocator.openProfileInstanceManager(profile1)).thenReturn(profileInstanceManager);
       
        ProfileResourceNode node1 = new ProfileResourceNode(new URI("node1"));
        ProfileResourceNode node2 = new ProfileResourceNode(new URI("node2"));
        ProfileResourceNode node3 = new ProfileResourceNode(new URI("node3"));
View Full Code Here

        testProfile.setSignatureFileName("DROID_SignatureFile_V26.xml");
        String path = "C:/Documents and Settings/rflitcroft/My Documents/matts_disk";
        //String path = "src/test/resources";
        testProfile.addResource(new DirectoryProfileResource(new File(path), true));
       
        ProfileInstanceManager profileInstance = profileContextLocator.openProfileInstanceManager(testProfile);
        //profileInstance.initProfile(sigFile.toURI());
        profileInstance.start().get();
       
       
        String[] profileIds = new String[] {
            "test",
        };
View Full Code Here

        long startTime = System.currentTimeMillis();
        if (!profileContextLocator.hasProfileContext(profileId)) {
            throw new RuntimeException("Profile not available");
        }
        ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
        ProfileInstanceManager profileInstancemanager = profileContextLocator.openProfileInstanceManager(profile);

        PlanetsXMLData planetsData = profileInstancemanager.getPlanetsData();

        planetsData.getProfileStat().setProfileStartDate(profile.getProfileStartDate());
        planetsData.getProfileStat().setProfileEndDate(profile.getProfileEndDate());
        planetsData.getProfileStat().setProfileSaveDate(profile.getDateCreated());
View Full Code Here

           
            for (String profileId : request.getProfileIds()) {
                ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
                report.addProfile(profile);
               
                ProfileInstanceManager profileInstanceManager =
                    profileContextLocator.openProfileInstanceManager(profile);
               
                Filter filterToUse = optionalFilter == null ? profile.getFilter() : optionalFilter;
               
                Criterion filter = ReportUtils.buildFilter(filterToUse, specItem.getFilter());
               
                List<ReportLineItem> reportData = profileInstanceManager.getReportData(
                        filter, specItem.getField(), specItem.getGroupByFields());
   
                for (ReportLineItem reportLineItem : reportData) {
                    final List<String> groupByValues = reportLineItem.getGroupByValues();
                    final String groupKey = getStringListKey(groupByValues);
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.profile.ProfileInstanceManager

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.