This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Reindexer extends BaseElasticsearchUtility { | |
private static Log logger = LogFactory.getLog(Reindexer.class); | |
public static void main(String[] args) { | |
if (args.length != 5) { | |
doUsage(); | |
System.exit(-1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.someco; | |
import java.io.IOException; | |
import com.google.api.client.http.GenericUrl; | |
import com.google.api.client.http.HttpRequest; | |
import com.google.api.client.http.HttpRequestFactory; | |
import com.google.api.client.http.HttpRequestInitializer; | |
import com.google.api.client.http.HttpTransport; | |
import com.google.api.client.http.javanet.NetHttpTransport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testDoc = session.getObjectByPath("/test/testfolder1/test1.txt") | |
catIds = testDoc.getPropertyValue("cm:categories") | |
for (catId in catIds) { | |
cat = session.getObject(catId) | |
println(cat.name) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def addCategory(documentPath, categoryName) { | |
println("Adding '" + categoryName + "' to the document at " + documentPath) | |
rs = session.query("select alfcmis:nodeRef from cm:category where cmis:name = '" + categoryName + "'", false) | |
if (rs.getTotalNumItems() == 0) { | |
println("Couldn't find category with name: " + categoryName) | |
return | |
} | |
catId = rs.getAt(0).getPropertyValueById("alfcmis:nodeRef") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rs = session.query("select cmis:objectId FROM cm:person where cm:firstName like 'Te%' and cm:organization like 'Green%' and cm:location like 'Dallas%' and (cm:companypostcode <> '75070' or cm:companypostcode is null)", false) | |
if (rs.getTotalNumItems() == 0) { | |
println("Couldn't find person that matched query") | |
return | |
} | |
for (res in rs) { | |
personId = res.getPropertyValueById("cmis:objectId") | |
person = session.getObject(personId) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rs = session.query("select R.cmis:objectId from rule:rule as R join cm:titled as T on R.cmis:objectId = T.cmis:objectId where T.cm:title = 'add classifiable aspect'", false) | |
if (rs.getTotalNumItems() == 0) { | |
println("Couldn't find a rule that matched your query") | |
return | |
} | |
for (res in rs) { | |
ruleId = res.getPropertyValueById('cmis:objectId') | |
rule = session.getObject(ruleId) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "someid", | |
"name": "globalNavSpecialOffersPromo", | |
"description": "", | |
"crDate": 1452112197971, | |
"modDate": 1457469890414, | |
"pubDate": 1457469840000, | |
"metadata": { | |
"pageId": [ | |
"air-flight-some-other-page", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = session.getObjectByPath('/versionableExample.txt') | |
println("Checked out?" + document.versionSeriesCheckedOut) | |
versions = document.getAllVersions() | |
for (version in versions) { | |
println ("Version:" + version.versionLabel + " PWC?:" + version.privateWorkingCopy) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.chemistry.opencmis.commons.* | |
import org.apache.chemistry.opencmis.commons.data.* | |
import org.apache.chemistry.opencmis.commons.enums.* | |
import org.apache.chemistry.opencmis.client.api.* | |
String cql = "SELECT D.cmis:name, T.cm:title FROM cmis:document as D join cm:titled as T on D.cmis:objectId = T.cmis:objectId" | |
ItemIterable<QueryResult> results = session.query(cql, false) | |
results.each { hit -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Content> fetchContentForPlacements(Date curDate, String relString, String pageId, Metadata meta) throws ContentServiceException { | |
// check for required parameters | |
if (pageId == null) { | |
throw new MissingParameterException(Constants.MSG_PAGE_ID_REQUIRED); | |
} | |
// default the current date to now if it wasn't provided | |
if (curDate == null) { | |
curDate = new Date(); |