com.github.dynamicextensionsalfresco.models.RepositoryModelRegistrar Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alfresco-integration Show documentation
Show all versions of alfresco-integration Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.models;
import com.github.dynamicextensionsalfresco.resources.ResourceHelper;
import org.alfresco.repo.dictionary.RepositoryLocation;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.service.cmr.admin.RepoAdminService;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.transaction.TransactionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Register models in the repository as cm:dictionaryModel's using the [RepoAdminService].
*/
public class RepositoryModelRegistrar extends AbstractModelRegistrar {
@Autowired
public RepositoryLocation customModelsRepositoryLocation;
@Autowired
public NodeService nodeService;
@Autowired
public RepoAdminService repoAdminService;
@Autowired
public TransactionService transactionService;
@Autowired
public ResourceHelper resourceHelper;
private Logger logger = LoggerFactory.getLogger(RepositoryModelRegistrar.class);
@Override
public void unregisterModels() {
// we do not unregister models as this can break existing content/index integrity
}
@Override
public void registerModel(final M2ModelResource modelResource) {
AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork
© 2015 - 2025 Weber Informatics LLC | Privacy Policy