本文整理汇总了Java中org.alfresco.util.ISO9075类的典型用法代码示例。如果您正苦于以下问题:Java ISO9075类的具体用法?Java ISO9075怎么用?Java ISO9075使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISO9075类属于org.alfresco.util包,在下文中一共展示了ISO9075类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getElementQName
import org.alfresco.util.ISO9075; //导入依赖的package包/类
public String getElementQName(Object o)
{
QName qName = ((ChildAssociationRef) o).getQName();
if(qName == null)
{
return "";
}
String escapedLocalName = ISO9075.encode(qName.getLocalName());
if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))
{
return qName.toString();
}
else
{
return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
}
}
示例4: 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();
}
示例5: buildXPath
import org.alfresco.util.ISO9075; //导入依赖的package包/类
private String buildXPath(Path path)
{
StringBuilder pathBuffer = new StringBuilder(64);
for (Iterator<Path.Element> elit = path.iterator(); elit.hasNext(); /**/)
{
Path.Element element = elit.next();
if (!(element instanceof Path.ChildAssocElement))
{
throw new IndexerException("Confused path: " + path);
}
Path.ChildAssocElement cae = (Path.ChildAssocElement) element;
if (cae.getRef().getParentRef() != null)
{
pathBuffer.append("/");
pathBuffer.append(getPrefix(cae.getRef().getQName().getNamespaceURI()));
pathBuffer.append(ISO9075.encode(cae.getRef().getQName().getLocalName()));
}
}
return pathBuffer.toString();
}
示例6: getClassificationNodes
import org.alfresco.util.ISO9075; //导入依赖的package包/类
private Set<NodeRef> getClassificationNodes(StoreRef storeRef, QName qname)
{
ResultSet resultSet = null;
try
{
resultSet = indexerAndSearcher.getSearcher(storeRef, false).query(storeRef, "lucene",
"PATH:\"/" + getPrefix(qname.getNamespaceURI()) + ISO9075.encode(qname.getLocalName()) + "\"", null);
Set<NodeRef> nodeRefs = new HashSet<NodeRef>(resultSet.length());
for (ResultSetRow row : resultSet)
{
nodeRefs.add(row.getNodeRef());
}
return nodeRefs;
}
finally
{
if (resultSet != null)
{
resultSet.close();
}
}
}
示例7: 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);
}
示例8: findTaggedNodes
import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
* @see org.alfresco.service.cmr.tagging.TaggingService#findTaggedNodes(StoreRef, java.lang.String)
*/
public List<NodeRef> findTaggedNodes(StoreRef storeRef, String tag)
{
// Lower the case of the tag
tag = tag.toLowerCase();
ResultSet resultSet= null;
try
{
// Do the search for nodes
resultSet = this.searchService.query(
storeRef,
SearchService.LANGUAGE_LUCENE,
"+PATH:\"/cm:taggable/cm:" + ISO9075.encode(tag) + "/member\"");
List<NodeRef> nodeRefs = resultSet.getNodeRefs();
return nodeRefs;
}
finally
{
if(resultSet != null) {resultSet.close();}
}
}
示例9: testEncodingOfTypeAndPropertyNames
import org.alfresco.util.ISO9075; //导入依赖的package包/类
public void testEncodingOfTypeAndPropertyNames() throws Exception
{
addTypeTestDataModel();
assertNotNull("Type not found by query name "+ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findTypeByQueryName(ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService))));
assertNotNull("Aspect not found by query name "+ISO9075.encodeSQL(aspectThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findTypeByQueryName(ISO9075.encodeSQL(aspectThatRequiresEncoding.toPrefixString(namespaceService))));
assertNotNull("Prop not found by query name "+ISO9075.encodeSQL(propertyThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findPropertyByQueryName(ISO9075.encodeSQL(propertyThatRequiresEncoding.toPrefixString(namespaceService))));
testQuery("SELECT * FROM "+ ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService)), 0, false, "cmis:allowedChildObjectTypeIds",
new String(), false);
testQuery("SELECT * FROM test:type_x002d_that_x002d_requires_x002d_encoding", 0, false, "cmis:allowedChildObjectTypeIds",
new String(), false);
testQuery("SELECT * FROM test:type_x002D_that_x002D_requires_x002D_encoding", 0, false, "cmis:allowedChildObjectTypeIds",
new String(), false);
}
示例10: createElementString
import org.alfresco.util.ISO9075; //导入依赖的package包/类
private String createElementString(NamespacePrefixResolver resolver)
{
StringBuilder sb = new StringBuilder(32);
if (ref.getParentRef() == null)
{
sb.append("/");
}
else
{
// a parent is present
sb.append(resolver == null ? ISO9075.getXPathName(ref.getQName()) : ISO9075.getXPathName(ref.getQName(), resolver));
}
if (ref.getNthSibling() > -1)
{
sb.append("[").append(ref.getNthSibling()).append("]");
}
return sb.toString();
}
示例11: AttributeElement
import org.alfresco.util.ISO9075; //导入依赖的package包/类
public AttributeElement(String attribute)
{
String qNameStr = null;
int idx = attribute.indexOf("[");
if(idx != -1)
{
String positionStr = attribute.substring(idx + 1, attribute.length() - 1);
position = Integer.parseInt(positionStr);
qNameStr = attribute.substring(1, idx);
}
else
{
qNameStr = attribute.substring(1);
}
this.attribute = ISO9075.parseXPathName(qNameStr);
}
示例12: encodePathISO9075
import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
* Helper to encode the elements of a path to be used as a Lucene PATH statement
* using the ISO9075 encoding. Note that leading and trailing '/' elements will NOT
* be preserved.
*
* @param path Path to encode, elements separated by '/'
*
* @return the encoded path, a minimum of the empty string will be returned
*/
public static String encodePathISO9075(String path)
{
if (path == null || path.length() == 0)
{
return "";
}
StringBuilder result = new StringBuilder(path.length() + 16);
for (StringTokenizer t = new StringTokenizer(path, "/"); t.hasMoreTokens(); /**/)
{
result.append(ISO9075.encode(t.nextToken()));
if (t.hasMoreTokens())
{
result.append('/');
}
}
return result.toString();
}
示例13: getSearchQuery
import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
* Build the search query from the passed in parameters and SEARCH_QUERY constant
*
* @param site SiteInfo
* @param author String
* @param daysAgo int
* @return Pair with the query string in first and query language in second
*/
protected Pair<String, String> getSearchQuery(SiteInfo site, String author, int daysAgo)
{
String search = String.format(SEARCH_QUERY,
(site != null ? "cm:" + ISO9075.encode(site.getShortName()) : "*"),
getDateXDaysAgo(daysAgo)
);
// If author equals 'mine' add cm:creator to the search query otherwise leave out
if(author.equals(DEFAULT_TOPIC_AUTHOR))
{
search += " AND @cm:creator:\"" + AuthenticationUtil.getFullyAuthenticatedUser() + "\"";
}
// Add the query string and language to the returned results
Pair<String, String> searchQuery = new Pair<String, String>(search, SearchService.LANGUAGE_FTS_ALFRESCO);
return searchQuery;
}
示例14: getXPathEscape
import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
* The ISO9075 encoding class should be used to encode local names. This
* method will encode all local names found in a path. For example
* "/app:company_home/cm:My Space//*" will become
* "/app:company_home/cm:My_x0020_Space//*"
*/
public static String getXPathEscape(String psToEncode) {
StringBuilder sbResult = new StringBuilder(psToEncode.length());
String sDelimiters = ":/_*";
StringTokenizer T = new StringTokenizer(psToEncode, sDelimiters, true);
while (T.hasMoreTokens()) {
String sToken = T.nextToken();
if (sDelimiters.contains(sToken))
sbResult.append(sToken);
else {
sbResult.append(ISO9075.encode(sToken));
}
}
String path = sbResult.toString();
path = path.replaceAll("//","/");
return path;
}
示例15: createSiteQuery
import org.alfresco.util.ISO9075; //导入依赖的package包/类
protected Query createSiteQuery(String site) throws ParseException
{
if(site.equals("_EVERYTHING_"))
{
return createTermQuery(FIELD_ISNODE, "T");
}
else if(site.equals("_ALL_SITES_"))
{
return getFieldQuery(FIELD_PATH, "/app:company_home/st:sites/*//*");
}
else if(site.equals("_REPOSITORY_"))
{
return createTermQuery(FIELD_ISNODE, "T");
}
else
{
return getFieldQuery(FIELD_PATH, "/app:company_home/st:sites/cm:" + ISO9075.encode(site)+"//*");
}
}