Package org.jayasoft.woj.common.model.content

Examples of org.jayasoft.woj.common.model.content.ModuleInfoImpl


   
    public void clearAllAssocations() {
      _localAsso.clearAll();
  }
  public void associate(String jarPath, Visibility v, String org, String name, String rev) {
    _localAsso.registerLocalAssociation(computeMD5(jarPath), new ModuleInfoImpl(org, name, rev, v, true, true));
  }
View Full Code Here


        try {
            SimpleMonitor.startTask("WojServicesHelper.getSource.fromModule"); //$NON-NLS-1$
            if(!isAutenticate()) {
                throw new NotSignedException(Messages.getString("common.badlogin.message")); //$NON-NLS-1$
            }
            ModuleInfo moduleInfo = new ModuleInfoImpl(org, name, rev, v, true, true);
            String source = WojServicesAccess.INSTANCE.getSource(moduleInfo, className, null);
            if(source == null || source.length()==0) {
                throw new WojException(Messages.getString("common.nosource.messsage")+className+" for module :"+moduleInfo); //$NON-NLS-1$ //$NON-NLS-2$
            }
            return source;
View Full Code Here

            SimpleMonitor.endTask("WojServicesHelper.getSource.fromModule"); //$NON-NLS-1$
        }
    }
    public URL getJavadocUrl(String org, String name, String rev, String className, Visibility v) throws ServiceException {
        //do not care about security here it is handled by server now
        ModuleInfo moduleInfo = new ModuleInfoImpl(org, name, rev, v, true, true);
        return WojServicesAccess.INSTANCE.getJavadocUrl(moduleInfo, className, null);
    }
View Full Code Here

        if(md5 != null) {
            ModuleDescriptorDao dao= WOJServer.getInstance().getDataService().getModuleDescriptorDao();
            ModuleDescriptor result = dao.getModuleDescriptor(md5, null, uak);
            if (result != null) {
            LOGGER.debug("ModuleInfo: " + result.toString() + " was found for md5: " + md5);
            return new ModuleInfoImpl(result.getOrganisation(), result.getModule(), result.getRevision(), result.getVisibility(), result.hasSources(), result.hasJavadoc());
            } else {
              LOGGER.warn("No ModuleInfo was found in DB for checksum: " + md5);
            }
        }
        return mi;
View Full Code Here

    ObjectInputStream ois = null;
    try {
          ois = new ObjectInputStream(new FileInputStream(_cachePath+"/"+LOCAL_ASSO_FILE_NAME)); //$NON-NLS-1$
      _associations = (Map) ois.readObject();
      for (Iterator iter = _associations.values().iterator(); iter.hasNext();) {
        ModuleInfoImpl mi = (ModuleInfoImpl) iter.next();
        mi.setVisibility(Visibility.PUBLIC);
      }
        } catch (Exception e) {
            //e.printStackTrace();
          _associations = new HashMap();
        } finally {
View Full Code Here

    ObjectOutputStream oos = null;
    //remove visibility since not serialisable and singleton class
    Map toSave = new HashMap();
    for (Iterator iter = _associations.keySet().iterator(); iter.hasNext();) {
      String key = (String) iter.next();
      ModuleInfoImpl mi = (ModuleInfoImpl) _associations.get(key);
      toSave.put(key, new ModuleInfoImpl(mi.getOrganisation(), mi.getModule(), mi.getRevision(), null, true, true));
    }
    try {
          oos = new ObjectOutputStream((new FileOutputStream(_cachePath+"/"+LOCAL_ASSO_FILE_NAME))); //$NON-NLS-1$
      oos.writeObject(toSave);
      oos.flush();
View Full Code Here

  }
   
   

    private ModuleInfo getModuleInfo(Revision rev) {
        return new ModuleInfoImpl(rev.getModule().getOrganisation().getName(), rev.getModule().getName(), rev.getName(), Visibility.PUBLIC, false, false);
    }
View Full Code Here

    }
    public ActionForward getDocUrl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        String org = request.getParameter("org");
        String name = request.getParameter("name");
        String rev = request.getParameter("rev");
        ModuleInfo md = new ModuleInfoImpl(org, name, rev, Visibility.PUBLIC, true, false);
        final URL javaDocUrl = Portal.getInstance().getServerServicesProvider().getContentService().getJavaDocUrl(md, "", "");
        //remove uak quite dirty
        final String url = javaDocUrl.toString();
        request.setAttribute("response", url.substring(0, url.length()-javaDocUrl.getQuery().length()-2));
        return mapping.findForward("module.javadoc");
View Full Code Here

    request.setAttribute("response",  getUrl(org, name, rev, type));
        return mapping.findForward("module.javadoc");
    }

  private String getUrl(String org, String name, String rev, String type) {
    ModuleInfo md = new ModuleInfoImpl(org, name, rev, Visibility.PUBLIC, true, false);
    final URL docURL = Portal.getInstance().getServerServicesProvider().getContentService().getDocumentUrl(md, "", "", type);
//remove uak quite dirty
//        final String url = docURL.toString();
//        request.setAttribute("response", url.substring(0, url.length()-docURL.getQuery().length()-2));
        String url = docURL.toString();
View Full Code Here

    public Label getDetectLabel() {
        return _detectLabel;
    }
   
    public ModuleInfoImpl getModuleInfo() {
        return new ModuleInfoImpl(_orgT.getText(), _nameT.getText(), _revisionT.getText(), (Visibility) ((StructuredSelection)_visibilityC.getSelection()).getFirstElement(), true, true);
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.model.content.ModuleInfoImpl

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.