本文整理匯總了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];
}
}
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
};
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}