本文整理匯總了Java中org.alfresco.service.cmr.repository.NodeRef.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java NodeRef.toString方法的具體用法?Java NodeRef.toString怎麽用?Java NodeRef.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.service.cmr.repository.NodeRef
的用法示例。
在下文中一共展示了NodeRef.toString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseRequestForNodeRef
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* Parses the request and providing it's valid returns the NodeRef.
*
* @param req The webscript request
* @return The NodeRef passed in the request
*
*/
protected NodeRef parseRequestForNodeRef(WebScriptRequest req)
{
// get the parameters that represent the NodeRef, we know they are present
// otherwise this webscript would not have matched
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String storeType = templateVars.get("store_type");
String storeId = templateVars.get("store_id");
String nodeId = templateVars.get("id");
// create the NodeRef and ensure it is valid
StoreRef storeRef = new StoreRef(storeType, storeId);
NodeRef nodeRef = new NodeRef(storeRef, nodeId);
if (!this.nodeService.exists(nodeRef))
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to find node: " + nodeRef.toString());
}
return nodeRef;
}
示例2: parseRequestForNodeRef
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
protected NodeRef parseRequestForNodeRef(WebScriptRequest req)
{
// get the parameters that represent the NodeRef, we know they are present
// otherwise this webscript would not have matched
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String storeType = templateVars.get("store_type");
String storeId = templateVars.get("store_id");
String nodeId = templateVars.get("id");
// create the NodeRef and ensure it is valid
StoreRef storeRef = new StoreRef(storeType, storeId);
NodeRef nodeRef = new NodeRef(storeRef, nodeId);
if (!this.nodeService.exists(nodeRef))
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to find node: " + nodeRef.toString());
}
return nodeRef;
}
示例3: startNode
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void startNode(NodeRef nodeRef)
{
try
{
AttributesImpl attrs = new AttributesImpl();
Path path = nodeService.getPath(nodeRef);
if (path.size() > 1)
{
// a child name does not exist for root
Path.ChildAssocElement pathElement = (Path.ChildAssocElement)path.last();
QName childQName = pathElement.getRef().getQName();
attrs.addAttribute(NamespaceService.REPOSITORY_VIEW_1_0_URI, CHILDNAME_LOCALNAME, CHILDNAME_QNAME.toPrefixString(), null, toPrefixString(childQName));
}
QName type = nodeService.getType(nodeRef);
contentHandler.startElement(type.getNamespaceURI(), type.getLocalName(), toPrefixString(type), attrs);
}
catch (SAXException e)
{
throw new ExporterException("Failed to process start node event - node ref " + nodeRef.toString(), e);
}
}
示例4: startACL
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void startACL(NodeRef nodeRef)
{
try
{
AttributesImpl attrs = new AttributesImpl();
boolean inherit = permissionService.getInheritParentPermissions(nodeRef);
if (!inherit)
{
attrs.addAttribute(NamespaceService.REPOSITORY_VIEW_1_0_URI, INHERITPERMISSIONS_LOCALNAME, INHERITPERMISSIONS_QNAME.toPrefixString(), null, "false");
}
contentHandler.startElement(ACL_QNAME.getNamespaceURI(), ACL_QNAME.getLocalName(), toPrefixString(ACL_QNAME), attrs);
}
catch (SAXException e)
{
throw new ExporterException("Failed to process start ACL event - node ref " + nodeRef.toString());
}
}
示例5: setValue
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public void setValue(Object value, ValueFields valueFields)
{
String textValue = null;
if (value != null)
{
if (!(value instanceof ActivitiScriptNode))
{
throw new ActivitiException("Passed value is not an instance of ActivitiScriptNode, cannot set variable value.");
}
NodeRef reference = (((ActivitiScriptNode)value).getNodeRef());
if (reference != null)
{
// Use the string representation of the NodeRef
textValue = reference.toString();
}
}
valueFields.setTextValue(textValue);
}
示例6: executeImpl
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef) {
List<ReportData> reportDataList = new ArrayList<ReportData>();
ResultSet expiredDocs = getExpiredContent();
for (int i = 0; i < expiredDocs.length(); i++) {
NodeRef expiredDoc = expiredDocs.getNodeRef(i);
if (nodeService.exists(expiredDoc)) {
ReportData reportData = new ReportData();
reportData.setName((String) nodeService.getProperty(expiredDoc, ContentModel.PROP_NAME));
String nodeRefStr = expiredDoc.toString();
reportData.setNodeRef(nodeRefStr);
reportData.setExpirationDate((Date) nodeService.getProperty(expiredDoc, ExpirableContentModel.PROP_EXPIRATION_DATE));
reportData.setPath(nodeService.getPath(expiredDoc).toString());
try {
nodeService.deleteNode(expiredDoc);
} catch (InvalidNodeRefException inre) {
LOG.warn("Tried to delete an invalid node, skipping: " + nodeRefStr);
continue;
}
reportDataList.add(reportData);
}
}
if (reportDataList.size() > 0) {
LOG.info("Delete expired content action deleted: " + reportDataList.size() + " documents.");
reportWriter.save(reportDataList);
} else {
LOG.info("Delete expired content action found nothing to delete.");
}
}
示例7: endNode
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void endNode(NodeRef nodeRef)
{
try
{
QName type = nodeService.getType(nodeRef);
contentHandler.endElement(type.getNamespaceURI(), type.getLocalName(), toPrefixString(type));
}
catch (SAXException e)
{
throw new ExporterException("Failed to process end node event - node ref " + nodeRef.toString(), e);
}
}
示例8: startAspect
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void startAspect(NodeRef nodeRef, QName aspect)
{
try
{
contentHandler.startElement(aspect.getNamespaceURI(), aspect.getLocalName(), toPrefixString(aspect), EMPTY_ATTRIBUTES);
}
catch (SAXException e)
{
throw new ExporterException("Failed to process start aspect event - node ref " + nodeRef.toString() + "; aspect " + toPrefixString(aspect), e);
}
}
示例9: endAspect
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public void endAspect(NodeRef nodeRef, QName aspect)
{
try
{
contentHandler.endElement(aspect.getNamespaceURI(), aspect.getLocalName(), toPrefixString(aspect));
}
catch (SAXException e)
{
throw new ExporterException("Failed to process end aspect event - node ref " + nodeRef.toString() + "; aspect " + toPrefixString(aspect), e);
}
}
示例10: testCancelled
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private void testCancelled(NodeRef transferRecord) throws TransferFatalException
{
Status currentStatus = Status.valueOf((String)nodeService.getProperty(transferRecord, TransferModel.PROP_TRANSFER_STATUS));
if (Status.CANCELLED.equals(currentStatus))
{
throw new TransferFatalException(MSG_TRANSFER_CANCELLED, new Object[] { transferRecord.toString() });
}
}
示例11: getUidValidityTransactionListener
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private UidValidityTransactionListener getUidValidityTransactionListener(NodeRef folderRef)
{
String key = UIDVALIDITY_TRANSACTION_LISTENER + folderRef.toString();
UidValidityTransactionListener txnListener = AlfrescoTransactionSupport.getResource(key);
if (txnListener == null)
{
txnListener = new UidValidityTransactionListener(folderRef);
AlfrescoTransactionSupport.bindListener(txnListener);
AlfrescoTransactionSupport.bindResource(key, txnListener);
}
return txnListener;
}
示例12: getNodeLinksIds
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public List<Long> getNodeLinksIds(NodeRef nodeRef)
{
/* Validate input */
PropertyCheck.mandatory(this, "nodeRef", nodeRef);
/* Get all links of the given nodeRef */
PagingRequest pagingRequest = new PagingRequest(0, 100000);
List<Long> nodeLinks = new ArrayList<Long>();
Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_LINK_DESTINATION);
if (nameQName != null)
{
// Execute the canned query if there are links in the database
GetDoclinkNodesCannedQueryParams parameterBean = new GetDoclinkNodesCannedQueryParams(nodeRef.toString(),
nameQName.getFirst(),
pagingRequest.getMaxItems());
CannedQueryParameters params = new CannedQueryParameters(parameterBean,
null,
null,
pagingRequest.getRequestTotalCountMax(),
pagingRequest.getQueryExecutionId());
CannedQuery<Long> query = new GetDoclinkNodesCannedQuery(cannedQueryDAO,
params);
CannedQueryResults<Long> results = query.execute();
for (Long nodeId : results.getPage())
{
nodeLinks.add(nodeId);
}
}
return nodeLinks;
}
示例13: getFileNameOrNodeRef
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private String getFileNameOrNodeRef(TransformationOptions options, boolean firstLevel, long sourceSize, boolean getName)
{
String result = getName ? null : "";
if (options != null)
{
try
{
NodeRef sourceNodeRef = options.getSourceNodeRef();
result = getName
? (String)nodeService.getProperty(sourceNodeRef, ContentModel.PROP_NAME)
: sourceNodeRef.toString()+" ";
}
catch (RuntimeException e)
{
; // ignore (normally InvalidNodeRefException) but we should ignore other RuntimeExceptions too
}
}
if (result == null)
{
if (!firstLevel)
{
result = getName ? "<<TemporaryFile>>" : "";
}
else if (sourceSize < 0)
{
// fileName = "<<AnyFile>>"; commented out as it does not add to debug readability
}
}
return result;
}
示例14: execute
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* @see org.alfresco.service.cmr.repository.ScriptProcessor#execute(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, java.util.Map)
*/
public Object execute(NodeRef nodeRef, QName contentProp, Map<String, Object> model)
{
try
{
if (this.services.getNodeService().exists(nodeRef) == false)
{
throw new AlfrescoRuntimeException("Script Node does not exist: " + nodeRef);
}
if (contentProp == null)
{
contentProp = ContentModel.PROP_CONTENT;
}
ContentReader cr = this.services.getContentService().getReader(nodeRef, contentProp);
if (cr == null || cr.exists() == false)
{
throw new AlfrescoRuntimeException("Script Node content not found: " + nodeRef);
}
// compile the script based on the node content
Script script;
Context cx = Context.enter();
try
{
script = cx.compileString(resolveScriptImports(cr.getContentString()), nodeRef.toString(), 1, null);
}
finally
{
Context.exit();
}
return executeScriptImpl(script, model, false, nodeRef.toString());
}
catch (Throwable err)
{
throw new ScriptException("Failed to execute script '" + nodeRef.toString() + "': " + err.getMessage(), err);
}
}
示例15: CustomModelDownload
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public CustomModelDownload(NodeRef nodeRef)
{
this.nodeRef = nodeRef.toString();
}