Package org.jayasoft.woj.tools.dl

Examples of org.jayasoft.woj.tools.dl.DLExplorer


    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);

        String root = settings.getDLDir().getPath();
        String outputFileName = settings.getLogsDir().getPath()+ "/dl-report.html";
        DLExplorer explorer = new DLExplorer(root);

        DLReporter reporter = new DLReporter(explorer);
        long start = System.currentTimeMillis();
        reporter.scanAll();
        System.out.println("scanned "+reporter._tested+" modules revisions in "+(System.currentTimeMillis()-start)+"ms");
View Full Code Here


        WojToolsSettings settings = WojToolsSettings.buildInstance(args);

        String localHostName = getLocalHostName();
        System.out.println("scanning " + settings.getDLDir()+ " on "+localHostName+" -- revision ("+DATE_FORMAT.format(new Date(REVISION_DATE))+")");
       
        DLExplorer explorer = new DLExplorer(settings.getDLDir().getAbsolutePath());
        DLAnalyzer analyzer = new DLAnalyzer(explorer);
        DLReporter reporter = new DLReporter(explorer);
       
        int analysed = 0;
        long total = 0;
        long start = System.currentTimeMillis();
        for (Organisation org : explorer.getOrganisations()) {
            System.out.println("scanning "+org.getName());
            for (Module module : explorer.getModules(org)) {
                System.out.println("\thandling module : " + module.getName());
                System.out.print("\t"+module.getName());
                for (Revision rev: explorer.getRevisions(module)) {
                        System.out.print(" "+rev.getName());
                        File desc = explorer.getRevisionDescriptorFile(rev);
                        RevisionDescriptor previousRd = null;
                        File previousFile = null;
                        if (desc.exists()) {
                            RevisionDescriptor rd = explorer.getDescriptor(rev);
                            long time = rd.getStatusTime();
                            if ("generated".equals(rd.getStatus()) && time  < REVISION_DATE) {
                                previousFile = new File(explorer.getRevisionDir(rev), "woj-crudemod-"+time+".xml");
                                IOHelper.move(desc, previousFile);
                                System.out.print("[DISCARD]");
                                try {
                                    previousRd = new RevisionDescriptor(rev, previousFile, Category.CATEGORIES);
                                    previousRd.readFile();
                                } catch (Exception ex) {
                                    previousRd = null;
                                }
                            }
                        }
                        if (!desc.exists()) {
                            File lock = new File(explorer.getRevisionDir(rev), ".analyze.lock");
                            if (lock.exists()) {
                               
                                String locking = "unknown";
                                try {
                                    locking = IOHelper.readEntirely(lock);
                                } catch (Exception ex) {
                                }
                                System.out.print("[LOCKED-"+locking+"]");
                                continue;
                            }
                            try {
                                IOHelper.writeFile(lock, localHostName);
                            } catch (Exception ex) {
                                System.out.print("[LOCKED--"+ex.getMessage()+"]");
                                continue;
                            }
                            try {
                                RevisionDescriptor rd = analyzer.analyze(rev);
                                rd.save();
                                System.out.print("[ANALYZED]");
                               
                                if (previousRd != null && previousRd.getAllItems().equals(rd.getAllItems())) {
                                    // new analyze lead to same content: we show same last modified timestamp
                                    rd.setLastModified(previousRd.getLastModified());
                                    previousFile.delete();
                                    System.out.print("[SAME]");
                                }
                               
                                reporter.scan(rev);
                                analysed++;
                            } finally {
                                IOHelper.delete(lock);
                            }
                        } else {
                            RevisionDescriptor rd = explorer.getDescriptor(rev);
                            System.out.print("[EXIST-"+rd.getStatus()+"-"+DATE_FORMAT.format(new Date(rd.getStatusTime()))+"]");                       
                        }
                        total++;
                }
                System.out.println();
View Full Code Here

    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
        String root = settings.getDLDir().getAbsolutePath();
        System.out.println("cleaning: " + root);

        DLExplorer explorer = new DLExplorer(root);
       
        long start = System.currentTimeMillis();
        long total = 0;
        for (Organisation org : explorer.getOrganisations()) {
            System.out.println("cleaning "+org.getName());
            for (Module module : explorer.getModules(org)) {
                System.out.print("\t"+module.getName());
                for (Revision rev: explorer.getRevisions(module)) {
                        File desc = explorer.getRevisionDescriptorFile(rev);
                        if (desc.exists()) {
                            InputStream is = null;
                            try {
                                is = new FileInputStream(desc);
                                SAXParserFactory.newInstance().newSAXParser().parse(
View Full Code Here

    public static void main(String[] args) throws Exception {
        WojToolsSettings settings = WojToolsSettings.buildInstance(args);
        String root = settings.getDLDir().getPath();
        System.out.println("scanning: " + root);

        DLExplorer explorer = new DLExplorer(root);
        DLJavadocGenerator generator = new DLJavadocGenerator(explorer);
       
        long generated = 0;
        Collection<Revision> errors = new ArrayList<Revision>();
        long total = 0;
        for (Organisation org : explorer.getOrganisations()) {
            System.out.println("scanning "+org.getName()+" for crude modules descriptors");
            for (Module module : explorer.getModules(org)) {
                System.out.print("\t"+module.getName());
                for (Revision rev: explorer.getRevisions(module)) {
                    System.out.print(" "+rev.getName());
                    try {
                        if (generator.analyze(rev)) {
                            generated++;
                        }
View Full Code Here

    _console = console;
  }

  public void actionPerformed(ActionEvent e) {
   
    DLExplorer dlExplorer = _console.getDlexplorer();
 
    RevisionChooser rChooser = _console.getDlPanel().getRevisionChooser();
    Revision revision = rChooser.getSelectedRevision();
    Module module = revision.getModule();
 
View Full Code Here

       
        _settings = settings;       
        UnifiedAuthentificationService.getInstance().setLoginInfo(_settings.getUserName(), _settings.getPassword(), getVersion());
    UnifiedAuthentificationService.getInstance().setAuthentificationServer(new Server(new URL(_settings.getServer())));
   
        _dlexplorer = new DLExplorer(_settings.getDLDir().getPath(), _settings.getDescriptorsDir().getPath());
        _moduleBuilder = new FromDLModuleBuilder(_dlexplorer, ClientServerServicesProvider.get(_settings.getServer()).getModuleManagementService(), _settings.getModulesDir());
        _analyzer = new DLAnalyzer(_dlexplorer);
    setLayout(new BorderLayout());
        add(createConsolePanels(), BorderLayout.CENTER);
        add(createButtonPanel(), BorderLayout.WEST);
View Full Code Here

   
    public static void main(String[] args) {
        try {
            WojToolsSettings settings = WojToolsSettings.buildInstance(args);
           
            DLExplorer explorer = new DLExplorer(settings.getDLDir().getPath());

            settings.getLogsDir().mkdirs();
            File trace = new File(settings.getLogsDir(), "moduleBuilder.log");
            File errors = new File(settings.getLogsDir(), "moduleBuilder.err");
            System.setErr(new PrintStream(errors));
            System.setOut(new PrintStream(trace));
           
            System.out.println("\n\n\nBEGINNING MODULE BUILDER "+new Date()+" - "+settings.getServer());
            System.err.println("\n\n\nBEGINNING MODULE BUILDER "+new Date()+" - "+settings.getServer());
           
            ClientServerServicesProvider ssp = ClientServerServicesProvider.get(settings.getServer());
      Authentification auth;
            auth = ssp.getAuthentificationService().authenticate(settings.getUserName(), settings.getPassword(), "");
     
      if (auth instanceof AuthSuccessfull) {
        ModuleManagementService mms = ssp.getModuleManagementService();
        FromDLModuleBuilder builder = new FromDLModuleBuilder(explorer, mms, settings.getModulesDir());
        for (Iterator iter = explorer.getAllRevisions().iterator(); iter.hasNext();) {
          Revision rev = (Revision)iter.next();
          builder.build(rev);
        }
        System.out.println("\nFINISHED");
      } else {
View Full Code Here

            auth = ssp.getAuthentificationService().authenticate(settings.getUserName(), settings.getPassword(), "");
           
            if (auth instanceof AuthSuccessfull) {
                ModuleManagementService mms = ssp.getModuleManagementService();
                RemoveModuleFromWOJBatch batch = new RemoveModuleFromWOJBatch(mms);
                batch.process(new DLExplorer(settings.getDLDir().getPath()));
                System.out.println("job done");
            } else {
                System.out.println("Authentication failed !");
            }
        } catch (Exception e) {
View Full Code Here

    public static void main(String[] args) {
        try {
            WojToolsSettings settings = WojToolsSettings.buildInstance(args);
            CleanPreparedModulesBatch batch = new CleanPreparedModulesBatch();
            batch.process(new DLExplorer(settings.getDLDir().getPath()), settings.getModulesDir().getPath());
            System.out.println("job done");
        } catch (Exception e) {
            e.printStackTrace();
            throw new BuildException("problem while removing old modules ...", e);
        }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.tools.dl.DLExplorer

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.