Examples of RepositoryHandler


Examples of org.gradle.api.artifacts.dsl.RepositoryHandler

        this.publicationServices = publicationServices;
        this.instantiator = instantiator;
    }

    public void apply(final Project project) {
        RepositoryHandler repositories = publicationServices.createRepositoryHandler();
        PublicationContainer publications = instantiator.newInstance(DefaultPublicationContainer.class, instantiator);

        // TODO Registering an extension should register it with the model registry as well
        project.getExtensions().create(PublishingExtension.NAME, DefaultPublishingExtension.class, repositories, publications);
View Full Code Here

Examples of org.gradle.api.artifacts.dsl.RepositoryHandler

    }

    private ClassPath resolvePluginDependencies(final PluginUseMetaData metadata) {
        DependencyResolutionServices resolution = dependencyResolutionServicesFactory.create();

        RepositoryHandler repositories = resolution.getResolveRepositoryHandler();
        final String repoUrl = metadata.implementation.get("repo");
        repositories.maven(new Action<MavenArtifactRepository>() {
            public void execute(MavenArtifactRepository mavenArtifactRepository) {
                mavenArtifactRepository.setUrl(repoUrl);
            }
        });
View Full Code Here

Examples of org.gradle.api.artifacts.dsl.RepositoryHandler

        List<Result> nonLegacy = categorizedResults.get(false);

        // Could be different to ids in the requests as they may be unqualified
        final Map<Result, String> legacyActualPluginIds = Maps.newLinkedHashMap();
        if (!legacy.isEmpty()) {
            final RepositoryHandler repositories = scriptHandler.getRepositories();
            final List<MavenArtifactRepository> mavenRepos = repositories.withType(MavenArtifactRepository.class);

            for (final Result result : legacy) {
                result.legacyFound.action.execute(new LegacyPluginResolveContext() {
                    public Dependency add(String pluginId, final String m2RepoUrl, Object dependencyNotation) {
                        legacyActualPluginIds.put(result, pluginId);

                        boolean repoExists = any(mavenRepos, new Spec<MavenArtifactRepository>() {
                            public boolean isSatisfiedBy(MavenArtifactRepository element) {
                                return element.getUrl().toString().equals(m2RepoUrl);
                            }
                        });
                        if (!repoExists) {
                            repositories.maven(new Action<MavenArtifactRepository>() {
                                public void execute(MavenArtifactRepository mavenArtifactRepository) {
                                    mavenArtifactRepository.setUrl(m2RepoUrl);
                                }
                            });
                        }
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

    // invoke handler delete callback
    Tracing.logDebug("deleteRepositoryEntry start entry=" + entry, this.getClass());
    entry = (RepositoryEntry) DBFactory.getInstance().loadObject(entry,true);
    Tracing.logDebug("deleteRepositoryEntry after load entry=" + entry, this.getClass());
    Tracing.logDebug("deleteRepositoryEntry after load entry.getOwnerGroup()=" + entry.getOwnerGroup(), this.getClass());
    RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
    OLATResource ores = entry.getOlatResource();
    if (!handler.readyToDelete(ores, ureq, wControl)) return false;

    // start transaction
    // delete entry picture
    File uploadDir = new File(FolderConfig.getCanonicalRoot() + FolderConfig.getRepositoryHome());
    File picFile = new File(uploadDir, entry.getKey() + ".jpg");
    if (picFile.exists()) {
      picFile.delete();
    }
    // delete all bookmarks referencing deleted entry
    BookmarkManager.getInstance().deleteAllBookmarksFor(entry);
    // delete all catalog entries referencing deleted entry
    CatalogManager.getInstance().resourceableDeleted(entry);
    // delete the entry
    entry = (RepositoryEntry) DBFactory.getInstance().loadObject(entry,true);
    Tracing.logDebug("deleteRepositoryEntry after reload entry=" + entry, this.getClass());
    Tracing.logDebug("deleteRepositoryEntry after reload entry.getOwnerGroup()=" + entry.getOwnerGroup(), this.getClass());
    SecurityGroup ownerGroup = entry.getOwnerGroup();
    deleteRepositoryEntry(entry);
    if (ownerGroup != null) {
      // delete secGroup
      Tracing.logDebug("deleteRepositoryEntry deleteSecurityGroup ownerGroup=" + ownerGroup, this.getClass());
      ManagerFactory.getManager().deleteSecurityGroup(ownerGroup);
    }
    // inform handler to do any cleanup work... handler must delete the
    // referenced resourceable aswell.
    handler.cleanupOnDelete(entry.getOlatResource(), ureq, wControl);
    Tracing.logDebug("deleteRepositoryEntry Done" , this.getClass());
    return true;
  }
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

  /**
   * Initialize form data based on repository entry.
   */
  public void init() {
   
    RepositoryHandler handler = null;
    handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(entry);
   
    canCopy = new CheckBoxElement("cif.canCopy", entry.getCanCopy());
    addFormElement("cif_canCopy", canCopy);

    canReference = new CheckBoxElement("cif.canReference", entry.getCanReference());
    addFormElement("cif_canReference", canReference);
   
    if (handler != null && handler.supportsLaunch()) {
      canLaunch = new CheckBoxElement("cif.canLaunch", entry.getCanLaunch());
      addFormElement("cif_canLaunch", canLaunch);
    } else { // launch not supported
      canLaunch = null;
      addFormElement("cif_canLaunch", new StaticHTMLTextElement("cif.canLaunch", translate("cif.canLaunch.na"), 255));
    }

    if (handler != null && handler.supportsDownload()) {
      canDownload = new CheckBoxElement("cif.canDownload", entry.getCanDownload());
      addFormElement("cif_canDownload", canDownload);
    } else { // download not supported
      canDownload = null;
      addFormElement("cif_canDownload", new StaticHTMLTextElement("cif.canDownload", translate("cif.canDownload.na"), 255));
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

      LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, c.getInitialComponent(), null);
      layoutCtr.addDisposableChildController(c); // dispose content on layout dispose
      return layoutCtr;
    }
    rm.incrementLaunchCounter(re);
    RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(re);
 
   
    // build up the context path
    OLATResourceable businessOres = re;
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(businessOres);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl)
 
    MainLayoutController ctrl = handler.getLaunchController(re.getOlatResource(), initialViewIdentifier, ureq, bwControl);
    if (ctrl == null) throw new AssertException("could not create controller for repositoryEntry "+re);
    if (ctrl instanceof MainLayoutController) {
      return ctrl;     
    } else {
      // add layout wrapper
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

      typeDisplayText.append(translate("cif.type.na"));
    }
    type = new StaticHTMLTextElement("cif.type", typeDisplayText.toString(), 255);
    addFormElement("cif_type", type);
   
    RepositoryHandler handler = null;
    if (typeName != null) handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(typeName);
   
    canCopy = new CheckBoxElement("cif.canCopy", entry.getCanCopy());
    if (enableAuthorView)
      addFormElement("cif_canCopy", canCopy);

    canReference = new CheckBoxElement("cif.canReference", entry.getCanReference());
    if (enableAuthorView)
      addFormElement("cif_canReference", canReference);

    if (handler != null && handler.supportsLaunch()) {
      canLaunch = new CheckBoxElement("cif.canLaunch", entry.getCanLaunch());
      addFormElement("cif_canLaunch", canLaunch);
    } else { // launch not supported
      canLaunch = null;
      addFormElement("cif_canLaunch", new StaticHTMLTextElement("cif.canLaunch", translate("cif.canLaunch.na"), 255));
    }

    if (handler != null && handler.supportsDownload()) {
      canDownload = new CheckBoxElement("cif.canDownload", entry.getCanDownload());
      addFormElement("cif_canDownload", canDownload);
    } else { // download not supported
      canDownload = null;
      addFormElement("cif_canDownload", new StaticHTMLTextElement("cif.canDownload", translate("cif.canDownload.na"), 255));
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

        fireEvent(ureq, Event.FAILED_EVENT);
        fireEvent(ureq, new EntryChangedEvent(sourceEntry, EntryChangedEvent.DELETED));
        return;
      }
      newEntry = descriptionController.getRepositoryEntry();                 
      RepositoryHandler typeToCopy = RepositoryHandlerFactory.getInstance().getRepositoryHandler(sourceEntry);     
      IAddController addController = typeToCopy.getAddController(null, null, ureq, getWindowControl());
      addController.repositoryEntryCreated(newEntry);

      getWindowControl().setInfo(translator.translate("add.success"));
      workflowSuccessful = true;
      fireEvent(ureq, Event.DONE_EVENT);
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

    preparedEntry.setDisplayname(newDispalyname);
    preparedEntry.setDescription(src.getDescription());
    String resName = src.getResourcename();
    if (resName == null) resName = "";
    preparedEntry.setResourcename(resName);
    RepositoryHandler typeToCopy = RepositoryHandlerFactory.getInstance().getRepositoryHandler(src);     
    OLATResourceable newResourceable = typeToCopy.createCopy(sourceEntry.getOlatResource(), ureq);
    if (newResourceable == null) {
      getWindowControl().setError(translator.translate("error.createcopy"));
      fireEvent(ureq, Event.FAILED_EVENT);
      return null;
    }
View Full Code Here

Examples of org.olat.repository.handlers.RepositoryHandler

      if (entry != null) {
        try {
          Tracing.logDebug("Cleanup : started", RepositoryCopyController.class);
          newEntry = (RepositoryEntry) DBFactory.getInstance().loadObject(newEntry,true);
          SecurityGroup secGroup = newEntry.getOwnerGroup();
          RepositoryHandler repositoryHandler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(newEntry);     
          Tracing.logDebug("Cleanup : repositoryHandler.cleanupOnDelete for olat-resource=" + newEntry.getOlatResource(), RepositoryCopyController.class);
          repositoryHandler.cleanupOnDelete(newEntry.getOlatResource(), null, this.getWindowControl());
          Tracing.logDebug("Cleanup : deleteRepositoryEntry", RepositoryCopyController.class);
          RepositoryManager.getInstance().deleteRepositoryEntry(newEntry);
          if (secGroup != null) { // delete owner group
            Tracing.logDebug("Cleanup : deleteSecurityGroup secGroup=" + secGroup, RepositoryCopyController.class);
            securityManager.deleteSecurityGroup(secGroup);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.