Skip to content

Instantly share code, notes, and snippets.

View cfalzone's full-sized avatar

Christopher Falzone cfalzone

  • Aquent
  • Erie County, PA
View GitHub Profile
long sessionLang=WebAPILocator.getLanguageWebAPI().getLanguage(request).getId();
long defaultLang=APILocator.getLanguageAPI().getDefaultLanguage().getId();
boolean checkIndex=false;
if(request.getParameter("language_id")==null && Config.getBooleanProperty("DEFAULT_CONTENT_TO_DEFAULT_LANGUAGE",false)) {
// consider default language. respecting language_id in parameters
query.append(" +(languageId:").append(defaultLang).append(" languageId:").append(sessionLang).append(") ");
checkIndex=true;
}
#set($p = ".*[\\x8].*")
<ol>
#foreach($con in $dotcontent.pull("+structureName:Agents +languageId:(1 || 3 || 4 || 5 || 6 || 7)", 0, "modDate desc"))
#if($con.get("aboutMe").matches($p))
<li> $con.purl - <b>Matched</b> </li>
#end
#end
[11/06/14 11:40:54:932 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: : Character reference "&#x8" is an invalid XML character.
com.dotcms.publishing.DotPublishingException: : Character reference "&#x8" is an invalid XML character.
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.a(SourceFile:230)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:82)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:72)
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:137)
at com.dotcms.rest.PublishThread.run(PublishThread.java:42)
at java.lang.Thread.run(Thread.java:724)
Caused by: com.thoughtworks.xstream.io.StreamException: : Character reference "&#x8" is an invalid XML character.
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:105)
/**
* Cleans a block of text for XML
* This was needed because some hidden characters commonly used in Japanese text can foul up the push publisher using SAXParser
*
* @param input The input to be cleaned
* @return The cleaned input
*/
public String cleanForXML(String input) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
[11/06/14 10:42:35:322 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: : Character reference "&#x1f" is an invalid XML character.
com.dotcms.publishing.DotPublishingException: : Character reference "&#x1f" is an invalid XML character.
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.a(SourceFile:230)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:82)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:72)
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:137)
at com.dotcms.rest.PublishThread.run(PublishThread.java:42)
at java.lang.Thread.run(Thread.java:724)
Caused by: com.thoughtworks.xstream.io.StreamException: : Character reference "&#x1f" is an invalid XML character.
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:105)
package com.aquent.osgi;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Enumeration;
import org.osgi.framework.BundleContext;
/**
* Cleans a block of text for XML
* This was needed because some hidden characters commonly used in Japanese text can foul up the push publisher using SAXParser
*
* @param input The input to be cleaned
* @return The cleaned input
*/
public String cleanForXML(String input) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
[10/06/14 12:33:57:615 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: : Character reference "&#x8" is an invalid XML character.
com.dotcms.publishing.DotPublishingException: : Character reference "&#x8" is an invalid XML character.
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.a(SourceFile:230)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:82)
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:72)
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:137)
at com.dotcms.rest.PublishThread.run(PublishThread.java:42)
at java.lang.Thread.run(Thread.java:724)
Caused by: com.thoughtworks.xstream.io.StreamException: : Character reference "&#x8" is an invalid XML character.
at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:105)
@cfalzone
cfalzone / AquentActivator.java
Created June 11, 2014 11:50
Rewrite Rules in Activator
public class AquentActivator extends ExtendedBundleActivator {
@Override
public void start ( BundleContext ctx ) throws Exception {
// Initializing services
initializeServices(ctx);
// Add Rewrite Rules
addRewriteRules();
}
[05/06/14 12:40:25:006 EDT] ERROR viewtools.TwitterTool: Error Fetching user's Followers
Server returned HTTP response code: 400 for URL: https://api.twitter.com/1.1/followers/list.json?screen_name=Please type your address here&cursor=-1&include_entities=1&include_rts=1
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=e9187a6a or
http://www.google.co.jp/search?q=22d3ffc1
TwitterException{exceptionCode=[e9187a6a-22d3ffc1 e4fd0a6b-37abf427 e4fd0a6b-37abf425], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:192)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:89)
at twitter4j.TwitterImpl.get(TwitterImpl.java:1817)