當前位置: 首頁>>代碼示例>>Java>>正文


Java NodeRef.isNodeRef方法代碼示例

本文整理匯總了Java中org.alfresco.service.cmr.repository.NodeRef.isNodeRef方法的典型用法代碼示例。如果您正苦於以下問題:Java NodeRef.isNodeRef方法的具體用法?Java NodeRef.isNodeRef怎麽用?Java NodeRef.isNodeRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.alfresco.service.cmr.repository.NodeRef的用法示例。


在下文中一共展示了NodeRef.isNodeRef方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUuids

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void setUuids(String[] uuids)
{
    this.uuids = new String[uuids.length];

    for(int i = 0; i < uuids.length; i++)
    {
        if(NodeRef.isNodeRef(uuids[i]))
        {
            NodeRef ref = new NodeRef(uuids[i]);
            this.uuids[i] = ref.getId();
        }
        else
        {
            this.uuids[i] = uuids[i];
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:18,代碼來源:UUIDSupport.java

示例2: checkNodeRefList

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private void checkNodeRefList(boolean hasValue, String line, int i)
{
    String value = checkValue(hasValue, line, i);

    if (value != null)
    {
        for (String nodeRefString: line.split(", *"))
        {
            nodeRefString = nodeRefString.trim();
            if (nodeRefString.length() != 0 && !NodeRef.isNodeRef(nodeRefString))
            {
                throw unexpectedProperty("Expected NodeRef value "+nodeRefString, line);
            }
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:17,代碼來源:TransformerPropertySetter.java

示例3: getValueAsString

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private <Q, S, E extends Throwable> String getValueAsString(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value)
{
	String nodeRefStr = null;
    if(!NodeRef.isNodeRef((String)value))
    {
        // assume the object id is the node guid
        StoreRef storeRef = getStore(lqpa);
    	nodeRefStr = storeRef.toString() + "/" + (String)value;
    }
    else
    {
    	nodeRefStr = (String)value;
    }

    Object converted = DefaultTypeConverter.INSTANCE.convert(dictionaryService.getDataType(DataTypeDefinition.NODE_REF), nodeRefStr);
    String asString = DefaultTypeConverter.INSTANCE.convert(String.class, converted);
    return asString;
}
 
開發者ID:Alfresco,項目名稱:alfresco-data-model,代碼行數:19,代碼來源:ObjectIdLuceneBuilder.java

示例4: getUUID

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public static String getUUID(String source)
{
 // Ignore version label  for now
    String ref;
    String versionLabel = null;
    String[] split = source.split(";");
    if(split.length == 1)
    {
        ref = source;
    }
    else
    {
        if(split[1].equalsIgnoreCase("PWC"))
        {
            throw new UnsupportedOperationException("Query for PWC is not supported");
        }
        
        ref = split[0];
        versionLabel = split[1];
    }
    
    
    if (NodeRef.isNodeRef(ref))
    {
        NodeRef nodeRef = new NodeRef(ref);
        return nodeRef.getId();
    }

    else
    {
       return ref;
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:34,代碼來源:DBQuery.java

示例5: setUuid

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
 * @param uuid the uud to set
 */
public void setUuid(String uuid)
{
    if(NodeRef.isNodeRef(uuid))
    {
        NodeRef ref = new NodeRef(uuid);
        this.uuid = ref.getId();
    }
    else
    {
        this.uuid = uuid;
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:UUIDSupport.java

示例6: toNodeRefQueitly

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public static Function<String, NodeRef> toNodeRefQueitly()
{
    return new Function<String, NodeRef>()
    {
        public NodeRef apply(String value)
        {
            if(value!=null && NodeRef.isNodeRef(value))
            {
                return new NodeRef(value);
            }
            return null;
        }
    };
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:15,代碼來源:NodeUtils.java

示例7: getValueAsString

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private <Q, S, E extends Throwable> String getValueAsString(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value)
{
	String nodeRefStr = (String)value;
    if(!NodeRef.isNodeRef((String)value))
    {
        // assume the value (object id) is the node guid
        StoreRef storeRef = getStore(lqpa);
    	nodeRefStr = storeRef.toString() + "/" + (String)value;
    }

    Object converted = DefaultTypeConverter.INSTANCE.convert(dictionaryService.getDataType(DataTypeDefinition.NODE_REF), nodeRefStr);
    String asString = DefaultTypeConverter.INSTANCE.convert(String.class, converted);
    return asString;
}
 
開發者ID:Alfresco,項目名稱:alfresco-data-model,代碼行數:15,代碼來源:ParentLuceneBuilder.java

示例8: process

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void process(Map<String, Object> entries)
{
	String value = (String)entries.remove(key);
	try
	{
		value = URLDecoder.decode(value, "UTF-8");
		Matcher matcher = pattern.matcher(value);
		if(matcher.matches())
		{
			String nodeRefStr = matcher.group(1);
			boolean isNodeRef = NodeRef.isNodeRef(nodeRefStr);
			if(isNodeRef)
			{
				NodeRef nodeRef = new NodeRef(nodeRefStr);
				entries.put("objectId", nodeRef.getId());
			}
			else
			{
				logger.warn("Activity page url contains an invalid NodeRef " + value);
			}
		}
		else
		{
			logger.warn("Failed to match activity page url for objectId extraction " + value);
		}
	}
	catch (UnsupportedEncodingException e)
	{
		logger.warn("Unable to decode activity page url " + value);
	}
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:32,代碼來源:BaseActivitySummaryProcessor.java

示例9: getActivitySummary

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public static Map<String, Object> getActivitySummary(JSONObject activitySummary, String activityType)
{
	Map<String, Object> summary = new HashMap<String, Object>();

	if(activityType.equals("org.alfresco.documentlibrary.file-added"))
	{
		String nodeRefStr = (String)activitySummary.remove("nodeRef");
		if(NodeRef.isNodeRef(nodeRefStr))
		{
			summary.put("objectId", new NodeRef(nodeRefStr).getId());
		}
		else
		{
			throw new RuntimeException("nodeRef " + nodeRefStr + " in activity feed is not a valid NodeRef");
		}
		String parentNodeRefStr = (String)activitySummary.remove("parentNodeRef");
		if(NodeRef.isNodeRef(parentNodeRefStr))
		{
			summary.put("parentObjectId", new NodeRef(parentNodeRefStr).getId());
		}
		else
		{
			throw new RuntimeException("parentNodeRef " + parentNodeRefStr + " in activity feed is not a valid NodeRef");
		}
		summary.put("lastName", activitySummary.get("lastName"));
		summary.put("firstName", activitySummary.get("firstName"));
		summary.put("title", activitySummary.get("title"));
	} else if(activityType.equals("org.alfresco.site.user-joined"))
	{
		summary.put("lastName", activitySummary.get("lastName"));
		summary.put("firstName", activitySummary.get("firstName"));
		summary.put("memberLastName", activitySummary.get("memberLastName"));
		summary.put("memberFirstName", activitySummary.get("memberFirstName"));
		summary.put("memberPersonId", activitySummary.get("memberUserName"));
		summary.put("role", activitySummary.get("role"));
		summary.put("title", activitySummary.get("title"));
	}

	return summary;
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:41,代碼來源:Activity.java

示例10: extractFavouriteNodes

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private Map<PersonFavouriteKey, PersonFavourite> extractFavouriteNodes(String userName, Type type, String nodes)
 {
 	PrefKeys prefKeys = getPrefKeys(type);
 	Map<PersonFavouriteKey, PersonFavourite> favouriteNodes = new HashMap<PersonFavouriteKey, PersonFavourite>();

     StringTokenizer st = new StringTokenizer(nodes, ",");
     while(st.hasMoreTokens())
     {
     	String nodeRefStr = st.nextToken();
     	nodeRefStr = nodeRefStr.trim();
     	if(!NodeRef.isNodeRef((String)nodeRefStr))
     	{
     		continue;
     	}

     	NodeRef nodeRef = new NodeRef((String)nodeRefStr);

     	if(!nodeService.exists(nodeRef))
     	{
     		continue;
     	}

if(permissionService.hasPermission(nodeRef, PermissionService.READ_PROPERTIES) == AccessStatus.DENIED)
{
	continue;
}

     	// get createdAt for this favourited node
     	// use ISO8601
StringBuilder builder = new StringBuilder(prefKeys.getAlfrescoPrefKey());
builder.append(nodeRef.toString());
builder.append(".createdAt");
String prefKey = builder.toString();
String createdAtStr = (String)preferenceService.getPreference(userName, prefKey);
Date createdAt = (createdAtStr != null ? ISO8601DateFormat.parse(createdAtStr): null);

     	String name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);

     	PersonFavourite personFavourite = new PersonFavourite(userName, nodeRef, type, name, createdAt);
     	PersonFavouriteKey key = personFavourite.getKey();
     	favouriteNodes.put(key, personFavourite);
     }

     return favouriteNodes;
 }
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:46,代碼來源:FavouritesServiceImpl.java

示例11: executeImpl

import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
 *
 * {@inheritDoc}
 */
@Override
protected Map<String, Object> executeImpl(final WebScriptRequest req, final Status status, final Cache cache)
{
    final Map<String, Object> model = new HashMap<>();

    final Object parsedContent = req.parseContent();
    if (!(parsedContent instanceof JSONObject))
    {
        throw new WebScriptException(Status.STATUS_BAD_REQUEST, "No or invalid request data provided - only JSON data is supported");
    }

    final List<NodeRef> nodesToBePurged = new ArrayList<>();
    try
    {
        final JSONObject rq = (JSONObject) parsedContent;
        final JSONArray nodes = rq.getJSONArray("nodes");

        for (int slot = 0; slot < nodes.length(); slot++)
        {
            final String nodeRefStr = nodes.getString(slot);
            if (nodeRefStr != null && NodeRef.isNodeRef(nodeRefStr))
            {
                final NodeRef nodeRef = new NodeRef(nodeRefStr);

                // check if the current user has the permission to purge the node
                this.validatePermission(nodeRef, AuthenticationUtil.getRunAsUser());

                // If there is a specific NodeRef, then that is the only Node that should be purged.
                // In this case, the NodeRef points to the actual node to be purged i.e. the node in
                // the archive store.
                nodesToBePurged.add(nodeRef);
            }
        }
    }
    catch (final JSONException jsonEx)
    {
        throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid request JSON data", jsonEx);
    }

    LOGGER.debug("Purging {} nodes", nodesToBePurged.size());
    LOGGER.trace("Purging nodes {}", nodesToBePurged);

    // Now having identified the nodes to be purged, we simply have to do it.
    this.nodeArchiveService.purgeArchivedNodes(nodesToBePurged);

    model.put(ArchivedNodesDelete.PURGED_NODES, nodesToBePurged);

    return model;
}
 
開發者ID:AFaust,項目名稱:alfresco-better-trashmanagement,代碼行數:54,代碼來源:ArchivedItemsDelete.java


注:本文中的org.alfresco.service.cmr.repository.NodeRef.isNodeRef方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。