Package org.alfresco.service.cmr.repository

Examples of org.alfresco.service.cmr.repository.NodeRef


    List<CMObject> model = new ArrayList<CMObject>();
    ResultSet rs = null;
    try {
      rs = serviceRegistry.getSearchService().query(sp);
      for (ResultSetRow row : rs) {
        NodeRef nodeRef = row.getNodeRef();
        if (serviceRegistry.getNodeService().exists(nodeRef)) {
          model.add(repositoryService.fetch(CMObject.class, nodeRef));
        }
      }
    } finally {
View Full Code Here


  public void refreshEntry(String entryId) {
    String q = String.format("ID:\"%1$s\"", entryId);
    List<NodeRef> l = AlfrescoUtil.getInstance().getResultSet(q);
    removeEntry(entryId);
    if (!l.isEmpty()) {
      CMObject o = repositoryService.fetch(CMObject.class, new NodeRef(entryId));
      getModel().add(o);
    }
  }
View Full Code Here

    List<CMObject> model = new ArrayList<CMObject>();
    ResultSet rs = null;
    try {
      rs = serviceRegistry.getSearchService().query(sp);
      for (ResultSetRow row : rs) {
        NodeRef nodeRef = row.getNodeRef();
        if (serviceRegistry.getNodeService().exists(nodeRef)) {
          model.add(repositoryService.fetch(CMObject.class, nodeRef));
        }
      }
    } finally {
View Full Code Here

    StringBuffer b = new StringBuffer(this.query);
    b.append(String.format(" +ID:\"%1$s\"", entryId));
    List<NodeRef> l = AlfrescoUtil.getInstance().getResultSet(b.toString());
    removeEntry(entryId);
    if (!l.isEmpty()) {
      CMObject o = repositoryService.fetch(CMObject.class, new NodeRef(entryId));
      getModel().add(o);
    }
  }
View Full Code Here

  public String getId() {
    return id;
  }

  public String getText() {
    String name = (String) serviceRegistry.getNodeService().getProperty(new NodeRef(contextFolderId),
        ContentModel.PROP_NAME);
    return String.format("Search results in %1$s", name);
  }
View Full Code Here

   */
  public boolean evaluate(Node node) {   
    FacesContext context = FacesContext.getCurrentInstance();

    // check the aspect, then check the active property
    NodeRef ref = new NodeRef(Repository.getStoreRef(), node.getId());
   
    // if the aspect hasn't yet been added, it can be enabled
    if (!node.hasAspect(QName.createQName(Model.NAMESPACE_SOMECO_CONTENT_MODEL, Model.ASPECT_SC_ENCRYPT))) {
      return true;
    }
View Full Code Here

   
    // otherwise check the active property
    FacesContext context = FacesContext.getCurrentInstance();
   
    // check the active property
    NodeRef ref = new NodeRef(Repository.getStoreRef(), node.getId());
    NodeService nodeSvc = Repository.getServiceRegistry(context).getNodeService();
        boolean active = (Boolean)nodeSvc.getProperty(ref, QName.createQName(Model.NAMESPACE_SOMECO_CONTENT_MODEL, Model.PROP_IS_ACTIVE));
   
        return active;
     }
View Full Code Here

        final Boolean activeFlag = Boolean.parseBoolean(active);
        final FacesContext fc = FacesContext.getCurrentInstance();

        if (id != null && id.length() != 0) {
            try {
                final NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
                RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(fc);
                RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>() {
                    public Object execute() throws Throwable {

                        ActionImpl action = new ActionImpl(ref, BaseExecuter.NAME, null);
View Full Code Here

        m_languages = configElement.getLanguages();

        // Set up the user information
        UserTransaction tx = transactionService.getUserTransaction();
        NodeRef homeSpaceRef = null;
        User user;
        try {
            tx.begin();
            // Set the authentication
            authComponent.setCurrentUser(userName);
            user = new User(userName, authService.getCurrentTicket(), personService.getPerson(userName));
            homeSpaceRef = (NodeRef) nodeService.getProperty(personService.getPerson(userName), ContentModel.PROP_HOMEFOLDER);
            if (homeSpaceRef == null) {
                logger.warn("Home Folder is null for user '" + userName + "', using company_home.");
                homeSpaceRef = (NodeRef) nodeService.getRootNode(Repository.getStoreRef());
            }
            user.setHomeSpaceId(homeSpaceRef.getId());
            tx.commit();
        } catch (Throwable ex) {
            logger.error(ex);

            try {
View Full Code Here

    @Autowired
    protected SearchService searchService;

    public boolean nodeDiffersFromResource(Resource resource, RepositoryLocation targetLocation) throws IOException {
        final NodeRef nodeRef = findNodeForResource(resource, targetLocation);
        return nodeRef == null || nodeDiffersFromResource(resource, nodeRef);
    }
View Full Code Here

TOP

Related Classes of org.alfresco.service.cmr.repository.NodeRef

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.