本文整理汇总了Java中org.alfresco.util.ISO9075.decode方法的典型用法代码示例。如果您正苦于以下问题:Java ISO9075.decode方法的具体用法?Java ISO9075.decode怎么用?Java ISO9075.decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.util.ISO9075
的用法示例。
在下文中一共展示了ISO9075.decode方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stringToPath
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Converts a String representation of a path to a Path
*
* e.g "/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}dictionary/{http://www.alfresco.org/model/application/1.0}transfers/{http://www.alfresco.org/model/content/1.0}default/{http://www.alfresco.org/model/transfer/1.0}snapshotMe";
* @param value the string representation of the path.
* @return Path
*/
public static Path stringToPath(String value)
{
Path path = new Path();
// pattern for QName e.g. /{stuff}stuff
Pattern pattern = Pattern.compile("/\\{[a-zA-Z:./0-9]*\\}[^/]*");
Matcher matcher = pattern.matcher(value);
// This is the root node
path.append(new SimplePathElement("/"));
while ( matcher.find() )
{
String group = matcher.group();
final String val = ISO9075.decode(group.substring(1));
path.append(new SimplePathElement(val));
}
return path;
}
示例2: getName
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
private String getName(QName qName)
{
String name = null;
try
{
name = qName.toPrefixString(namespaceService);
}
catch (NamespaceException e)
{
name = qName.toPrefixString();
}
name = ISO9075.decode(name);
return name;
}
示例3: getChildAxisIterator
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
public Iterator getChildAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI) throws UnsupportedAxisException
{
// decode the localname
localName = ISO9075.decode(localName);
// MNT-10730
if (localName != null && (localName.equalsIgnoreCase("true") || localName.equalsIgnoreCase("false")))
{
return Collections.singletonList(new Boolean(Boolean.parseBoolean(localName))).iterator();
}
ChildAssociationRef assocRef = (ChildAssociationRef) contextNode;
NodeRef childRef = assocRef.getChildRef();
QName qName = QName.createQName(namespaceURI, localName);
List<? extends ChildAssociationRef> list = null;
list = nodeService.getChildAssocs(childRef, RegexQNamePattern.MATCH_ALL, qName);
// done
return list.iterator();
}
示例4: getDisplayLabel
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
@Override
public FacetLabel getDisplayLabel(String value)
{
// Solr returns the site short name encoded
value = ISO9075.decode(value);
String title = null;
if (nonSiteLocationsLabels.containsKey(value))
{
title = nonSiteLocationsLabels.get(value);
}
else
{
SiteService siteService = serviceRegistry.getSiteService();
SiteInfo siteInfo = siteService.getSite(value);
title = siteInfo != null ? siteInfo.getTitle() : value;
}
return new FacetLabel(value, title, -1);
}
示例5: getSiteShortName
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Returns the short name of the site this node is located within. If the
* node is not located within a site null is returned.
*
* @return The short name of the site this node is located within, null
* if the node is not located within a site.
*/
public String getSiteShortName()
{
if (!this.siteNameResolved)
{
this.siteNameResolved = true;
Path path = this.services.getNodeService().getPath(getNodeRef());
if (logger.isDebugEnabled())
logger.debug("Determing if node is within a site using path: " + path);
for (int i = 0; i < path.size(); i++)
{
if ("st:sites".equals(path.get(i).getPrefixedString(this.services.getNamespaceService())))
{
// we now know the node is in a site, find the next element in the array (if there is one)
if ((i+1) < path.size())
{
// get the site name
Path.Element siteName = path.get(i+1);
// remove the "cm:" prefix and add to result object
this.siteName = ISO9075.decode(siteName.getPrefixedString(
this.services.getNamespaceService()).substring(3));
}
break;
}
}
}
if (logger.isDebugEnabled())
{
logger.debug(this.siteName != null ?
"Node is in the site named \"" + this.siteName + "\"" : "Node is not in a site");
}
return this.siteName;
}
示例6: getSiteShortName
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Returns the short name of the site this node is located within. If the
* node is not located within a site null is returned.
*
* @return The short name of the site this node is located within, null
* if the node is not located within a site.
*/
public String getSiteShortName()
{
if (!this.siteNameResolved)
{
this.siteNameResolved = true;
Path path = this.services.getNodeService().getPath(getNodeRef());
for (int i = 0; i < path.size(); i++)
{
if ("st:sites".equals(path.get(i).getPrefixedString(this.services.getNamespaceService())))
{
// we now know the node is in a site, find the next element in the array (if there is one)
if ((i+1) < path.size())
{
// get the site name
Path.Element siteName = path.get(i+1);
// remove the "cm:" prefix and add to result object
this.siteName = ISO9075.decode(siteName.getPrefixedString(
this.services.getNamespaceService()).substring(3));
}
break;
}
}
}
return this.siteName;
}
示例7: getPrimaryPath
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Gets the current node primary path
*
* @return primary path
*/
public String getPrimaryPath()
{
if (primaryPath == null)
{
primaryPath = getNodeService().getPath(getNodeRef());
}
return ISO9075.decode(primaryPath.toString());
}
示例8: getSiteShortName
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Returns the short name of the site this node is located within. If the node is not located within a site null is
* returned.
*
* @return The short name of the site this node is located within, null if the node is not located within a site.
*/
public String getSiteShortName(NodeRef nodeRef)
{
String result = null;
Path path = nodeService.getPath(nodeRef);
if (logger.isDebugEnabled())
logger.debug("Determing if node is within a site using path: " + path);
for (int i = 0; i < path.size(); i++)
{
if ("st:sites".equals(path.get(i).getPrefixedString(namespaceService)))
{
// we now know the node is in a site, find the next element in the array (if there is one)
if ((i + 1) < path.size())
{
// get the site name
Path.Element siteName = path.get(i + 1);
// remove the "cm:" prefix and add to result object
result = ISO9075.decode(siteName.getPrefixedString(namespaceService).substring(3));
}
break;
}
}
if (logger.isDebugEnabled())
{
logger.debug(result != null ? "Node is in the site named \"" + result + "\"" : "Node is not in a site");
}
return result;
}
示例9: parentNodeRefFor
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
private NodeRef parentNodeRefFor(Reference parentReference, boolean failIfNotFound)
{
NodeRef fParentRef;
if (path == null || path.length() == 0)
{
fParentRef = parentReference.execute(new GetActualNodeRefMethod(env));
}
else
{
String[] pathElements = NodeRefPathExpression.splitAndNormalizePath(path);
for (int i = 0; i < pathElements.length; i++)
{
pathElements[i] = ISO9075.decode(pathElements[i]);
}
fParentRef = env.findQNamePath(pathElements);
}
boolean noReadPermissions = false;
if (fParentRef != null && !env.hasPermission(fParentRef,
PermissionService.READ_PERMISSIONS))
{
fParentRef = null;
noReadPermissions = true;
}
if (logger.isDebugEnabled())
{
if (fParentRef == null)
{
if (noReadPermissions)
{
logger.debug("Current user does not have READ_PERMISSIONS for filing path" + path + ".");
}
else
{
logger.debug("The filing path " + path + " doesn't exist.");
}
}
}
if (failIfNotFound && fParentRef == null)
{
throw new VirtualizationException("The filing path " + path + " could not be resolved.");
}
return fParentRef;
}
示例10: getText
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
static private String getText(Tree node, boolean returnTextFromUnknownNodes)
{
String text = node.getText();
int index;
switch (node.getType())
{
case FTSParser.FTSWORD:
case FTSParser.FTSPRE:
case FTSParser.FTSWILD:
index = text.indexOf('\\');
if (index == -1)
{
return text;
}
else
{
return unescape(text);
}
case FTSParser.FTSPHRASE:
String phrase = text.substring(1, text.length() - 1);
index = phrase.indexOf('\\');
if (index == -1)
{
return phrase;
}
else
{
return unescape(phrase);
}
case FTSParser.ID:
index = text.indexOf('\\');
if (index == -1)
{
return ISO9075.decode(text);
}
else
{
return ISO9075.decode(unescape(text));
}
case FTSParser.URI:
case FTSParser.OR:
case FTSParser.AND:
case FTSParser.NOT:
case FTSParser.TILDA:
case FTSParser.PLUS:
case FTSParser.MINUS:
case FTSParser.COLON:
case FTSParser.STAR:
case FTSParser.DOTDOT:
case FTSParser.DOT:
case FTSParser.AMP:
case FTSParser.EXCLAMATION:
case FTSParser.BAR:
case FTSParser.EQUALS:
case FTSParser.QUESTION_MARK:
case FTSParser.TO:
case FTSParser.COMMA:
case FTSParser.CARAT:
case FTSParser.DOLLAR:
case FTSParser.AT:
case FTSParser.PERCENT:
case FTSParser.DECIMAL_INTEGER_LITERAL:
case FTSParser.FLOATING_POINT_LITERAL:
case FTSParser.DATETIME:
return text;
default:
if(returnTextFromUnknownNodes)
{
return text;
}
else
{
return "";
}
}
}
示例11: getPrimaryPath
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Gets the current node primary path
*
* @return primary path
*/
public String getPrimaryPath(NodeRef nodeRef)
{
Path primaryPath = getNodeService().getPath(nodeRef);
return ISO9075.decode(primaryPath.toString());
}
示例12: getPrimaryPrefixedPath
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Gets the current node primary path
*
* @return primary path
*/
public String getPrimaryPrefixedPath(NodeRef nodeRef)
{
Path primaryPath = getNodeService().getPath(nodeRef);
return ISO9075.decode(primaryPath.toPrefixString(getNamespaceService()));
}
示例13: updatePathRelatedFields
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* @param nodeMetaData
* @param doc
*/
private void updatePathRelatedFields(NodeMetaData nodeMetaData, SolrInputDocument doc)
{
doc.removeField(FIELD_PATH);
doc.removeField(FIELD_SITE);
doc.removeField(FIELD_TAG);
doc.removeField(FIELD_TAG_SUGGEST);
boolean repoOnly = true;
for (Pair<String, QName> path : nodeMetaData.getPaths())
{
doc.addField(FIELD_PATH, path.getFirst());
Matcher matcher = CAPTURE_SITE.matcher(path.getFirst());
if(matcher.find())
{
repoOnly = false;
doc.addField(FIELD_SITE, ISO9075.decode(matcher.group(1)));
}
matcher = CAPTURE_SHARED_FILES.matcher(path.getFirst());
if(matcher.find())
{
repoOnly = false;
doc.addField(FIELD_SITE, SHARED_FILES);
}
matcher = CAPTURE_TAG.matcher(path.getFirst());
if(matcher.find())
{
String tag = ISO9075.decode(matcher.group(1));
doc.addField(FIELD_TAG, tag);
doc.addField(FIELD_TAG_SUGGEST, tag);
}
}
if(repoOnly)
{
doc.addField(FIELD_SITE, NO_SITE);
}
}
示例14: ISO9075Decode
import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
* Decode a string from ISO9075
*
* @param s Value to decode
*
* @return decoded value
*/
public String ISO9075Decode(String s)
{
return ISO9075.decode(s);
}