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
@cfalzone
cfalzone / gist:9f5c2453a0afb560be30
Created June 27, 2014 15:08
Latest Velocity Logging
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: #--------------------------------------------------------------------------------------
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: #
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # Velocity Error
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # on url : aquent.com/contact-us/results.htm
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # on req : /contact-us/results.htm
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # with macro : #dotParse
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # on template : /assets/9/c/9c046214-e4fd-4381-b534-7c701fc763f1/fileAsset/agent-badge.vtl
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # stack:
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # -- /live/abf95beb-b44b-4968-964a-529e4db8478c.dotpage
[27/06/14 06:37:42:450 EDT] ERROR velocity.VelocityServlet: # -- /live/887747c8-e6b5-43ce-a681-f
@cfalzone
cfalzone / gist:ca031d3a4e534f1a62f9
Last active August 29, 2015 14:03
DotCMS Pagination Example
#macro(myPagination $currentPage $totalPages)
#if($UtilMethods.isSet($currentPage) && $UtilMethods.isSet($totalPages))
#set($currentPage = $math.toInteger($currentPage))
#set($titalPage = $math.toInteger($totalPages))
#if($currentPage > 0 && $currentPage <= $totalPages)
#set($pageMap = $contents.getEmptyMap())
#set($prev = $math.sub($currentPage, 1))
#set($next = $math.add($currentPage, 1))
#set($nextToLast = $math.sub($totalPages, 1))
@cfalzone
cfalzone / Test.java
Created June 20, 2014 15:07
Deleting content and related file field in dotCMS
package com.aquent;
import java.util.List;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.business.UserAPI;
import com.dotmarketing.db.HibernateUtil;
import com.dotmarketing.portlets.contentlet.business.ContentletAPI;
import com.dotmarketing.portlets.contentlet.model.Contentlet;
import com.dotmarketing.util.Logger;
18/06/14 12:39:55:088 EDT] ERROR velocity.VelocityServlet: #--------------------------------------------------------------------------------------
[18/06/14 12:39:55:088 EDT] ERROR velocity.VelocityServlet: #
[18/06/14 12:39:55:088 EDT] ERROR velocity.VelocityServlet: # Velocity Error
[18/06/14 12:39:55:088 EDT] ERROR velocity.VelocityServlet: # on url : aquent.com/blog/post.htm
[18/06/14 12:39:55:088 EDT] ERROR velocity.VelocityServlet: # on req : /blog/why-every-company-needs-a-content-strategy
[18/06/14 12:39:55:089 EDT] ERROR velocity.VelocityServlet: # with macro : #dotParse
[18/06/14 12:39:55:089 EDT] ERROR velocity.VelocityServlet: # on template : /assets/f/5/f53eddf8-3d4c-40bb-8cc1-d2e5a2123a12/fileAsset/geolocation.vtl
[18/06/14 12:39:55:089 EDT] ERROR velocity.VelocityServlet: # stack:
[18/06/14 12:39:55:089 EDT] ERROR velocity.VelocityServlet: # -- /live/4aa6582c-07d9-4c9b-8957-8a6dfe2274e4.dotpage
[18/06/14 12:39:55:089 EDT] ERROR velocity.VelocityServlet: # -- /live/ecc243c3-7
[18/06/14 12:38:00:052 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: ERROR: insert or update on table "workflow_action" violates foreign key constraint "workflow_action_next_assign_fkey"
Detail: Key (next_assign)=(51684c81-8220-48f2-b76e-0bed38403425) is not present in table "cms_role".
com.dotcms.publishing.DotPublishingException: ERROR: insert or update on table "workflow_action" violates foreign key constraint "workflow_action_next_assign_fkey"
Detail: Key (next_assign)=(51684c81-8220-48f2-b76e-0bed38403425) is not present in table "cms_role".
at com.dotcms.enterprise.publishing.remote.handler.WorkflowHandler.a(SourceFile:206)
at com.dotcms.enterprise.publishing.remote.handler.WorkflowHandler.handle(SourceFile:73)
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.dotmarketing.exception.DotDataException: ERROR: insert or update on tabl
## SET UP JOB FROM QUERY STRING
#if(!$UtilMethods.isSet($URLMapContent))##
#if( !$UtilMethods.isSet( $request.getParameter('jobId') ) )##
#set($jobID = $request.getParameter('jobId'))##
#set($jobQuery = "+structureName:aquentJob +aquentJob.jobId:${jobID}")##
#set($jobSort = "modDate desc")##
#else##
#set($jobQuery = "+structureName:aquentJob")##
#set($jobSort = "random")##
#end##
## SET UP JOB FROM QUERY STRING
#if($URLMapContent || $UtilMethods.isSet($request.getParameter('jobId')))##
#set( $jobID = $!URLMapContent.agentId )##
#if( !$UtilMethods.isSet( $request.getParameter('jobId') ) )##
#set( $jobID = $!URLMapContent.agentId )##
#end##
#if($UtilMethods.isSet( $jobID ))##
#set($jobQuery = "+structureName:aquentJob +aquentJob.jobId:${jobID}")##
#set($URLMapContent = $dotcontent.pull($jobQuery,1,'').get(0))##
## GRAB THE JOB AGENT AS WELL
{
"varname":"LandingPage",
"description":"Dynamically generated landing pages for campaigns",
"host":"aquent.com",
"name":"Landing Page - AQ",
"fields":[
{
"varname":"title",
"name":"Title",
"indexName":"text1",
108.31.179.217 - - [11/Jun/2014:15:28:13 -0400] "GET /fonts/aquent-magic/3.2/aquent-magic.min.css?1402514892478 HTTP/1.1" 200 1132 dotcms-web1.aquent.com:8080 "assets.aquent.com"
80.219.128.78 - - [11/Jun/2014:15:28:15 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1440 dotcms-web1.aquent.com:8080 "assets.aquent.com"
68.111.229.117 - - [11/Jun/2014:15:28:22 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1441 dotcms-web2.aquent.com:8080 "assets.aquent.com"
173.212.179.161 - - [11/Jun/2014:15:28:23 -0400] "GET /fonts/aquent-magic/3.3.0/aquent-magic.min.css?1402514902414 HTTP/1.1" 200 4663 dotcms-web2.aquent.com:8080 "assets.aquent.com"
74.202.141.18 - - [11/Jun/2014:15:28:25 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1440 dotcms-web2.aquent.com:8080 "assets.aquent.com"
68.82.61.222 - - [11/Jun/2014:15:28:27 -0400] "GET /fonts/aquent-magic/3.3.0/aquent-magic.min.css?1402514907268 HTTP/1.1" 200 4660 dotcms-web2.aquent.com:8080
49.188.32.13 - - [07/May/2014:23:56:31 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1439 dotcms-web1.aquent.com:8080 "assets.aquent.com"
99.244.118.189 - - [07/May/2014:23:56:34 -0400] "GET /fonts/aquent-magic/3.3.0/aquent-magic.min.css?1399521394106 HTTP/1.1" 200 4800 dotcms-web2.aquent.com:8080 "assets.aquent.com"
99.135.28.129 - - [07/May/2014:23:56:38 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1440 dotcms-web1.aquent.com:8080 "assets.aquent.com"
202.124.195.19 - - [07/May/2014:23:56:40 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1441 dotcms-web2.aquent.com:8080 "assets.aquent.com"
1.187.47.172 - - [07/May/2014:23:56:48 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1439 dotcms-web1.aquent.com:8080 "assets.aquent.com"
14.201.153.26 - - [07/May/2014:23:56:51 -0400] "GET /fonts/aquent-magic/current/aquent-magic.min.css HTTP/1.1" 200 1302 dotcms-web2.aquent.com:8080 "assets.aquent.com"
71.2