Skip to content

Instantly share code, notes, and snippets.

@wezell
Created May 14, 2012 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wezell/2693789 to your computer and use it in GitHub Desktop.
Save wezell/2693789 to your computer and use it in GitHub Desktop.
URLMapperError
[14/05/12 08:52:01:515 EDT] WARN bundlers.URLMapBundler: Bundle Failed: cant get host for com.dotmarketing.portlets.contentlet.model.Contentlet@41eebf22[map={wfActionAssign=null, tag=, videothumb1=null, videothumb2=null, stInode=0afc3ce3-6bd5-4659-8a47-b63c3e0a0d5d, videothumb3=null, videothumb4=null, videothumb5=null, disabledWYSIWYG=[documentation], wfActionComments=null, title=Files as Content, reviewInternal=1y, sinceVersion=2.0, userLevel=CM,CA,, modUser=dotcms.org.2805, diagram1=null, diagram2=null, diagram8=null, diagram7=null, diagram9=null, file2=null, diagram4=null, diagram3=null, sortOrder=0, diagram6=null, diagram5=null, file1=null, diagram11=null, diagram10=null, lastReview=2012-05-10 23:02:52.454, languageId=1, folder=SYSTEM_FOLDER, nextReview=2013-05-10 23:02:52.454, modDate=2012-05-10 23:02:52.471, availableOn=1, wikiTitle=FilesAsContent, documentation=<p>In previous versions of dotCMS when you uploaded a file you didn't have the ability to add additional metadata to them.</p>
<p>In dotCMS 2.0 when you create a new file, you are creating a new piece of content.</p>
<p><strong>Why is this important?</strong></p>
<ul>
<li>New file types can be created, fields can be customized on a per filetype basis.</li>
<li>Same tools as content, you can add taxonomy, tags, fields to files, relate files and pull files with lucene queries.</li>
<li>Allows you to easily create a document management or asset management solution</li>
<li>Workflows can be applied to files based on their content types. So your photo library can have one type of workflow vs. your document library.</li>
<li>URL addressable binary files with all the benefits of being content.</li>
<li>CDN friendly pathing to image manipulation with no query strings.</li>
</ul>
<p ALIGN="center">
<iframe src="http://blip.tv/play/he9%2BgvTTBQA.html?p=1&autostart=false" width="825" height="600" frameborder="0" allowfullscreen></iframe>
<embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#he9+guWWPAI" style="display:none"></embed>
</p>
<div class="clear"></div>
<p>To create a new file, go to the Website Browser and select a folder, then right click on the folder and click on: New --> Image or File.</p>
<p>A popup dialog will show up asking to select the file asset type you wish you upload.
<br>This drop down will display all the content types of type: File Asset. The list shows the content types that are available to use for the editor based on permissions.
</p>
<p align="center"><img src="/documentation/images/files-as-content/filecont1.jpg" alt="New File Asset" width="934"></p>
<p>Once you select a File Asset Type you will be redirected to the Edit Content screen, this is the same page you use to create or edit content and that is now how we will add and edit files</p>
<p>This screen will display all the fields that have been created for the selected content type</p>
<p align="center"><img src="/documentation/images/files-as-content/filecont2.jpg" alt="Edit File Asset" width="934"></p>
<p>If you select a different File Asset type the screen will display different fields as shown below</p>
<p align="center"><img src="/documentation/images/files-as-content/filecont3.jpg" alt="Edit File Asset - Document" width="934"></p>
<p>Whenever a new file is uploaded dotCMS automatically extracts its Metadata, and this information is displayed on the Metadata tab. For more information on how this process works please go to:
<a href="http://dotcms.com/docs/2.0/MetadataExtractionIndexing?">Metadata Extraction / Indexing</a></p>
<p>If you want to create or modify a File Asset type, go to Structures and click on the drop down to select: File content type.<p>
<p>This will show you the listing of all the content types in dotCMS that are File Assets.<p>
<p>From this page you will be able to Add or Edit your File content types the same way you manage other content types.<p>
<p align="center"><img src="/documentation/images/files-as-content/filecont4.jpg" alt="Structure Listing" width="934"></p>
<p>On the Edit / Add Content type page you will find a list of all the fields on this file asset. Make sure you all newly created fields are added above the Metadata field if you want them to show up on the
first edit page tab.</p>
<p align="center"><img src="/documentation/images/files-as-content/filecont5.jpg" alt="Edit / Add Structure" width="934"></p>
, owner=dotcms.org.2805, inode=d3b8a90f-bb19-4b02-a391-292e460afc2b, identifier=8f1ee047-a949-41b5-b639-7ca408e83bce, wfActionId=null},lowIndexPriority=false] reason null
[14/05/12 08:52:01:516 EDT] WARN bundlers.URLMapBundler: Bundle Failed: cant get host for com.dotmarketing.portlets.contentlet.model.Contentlet@33b76edf[map={wfActionAssign=null, tag=Table of Contents, videothumb1=null, videothumb2=null, stInode=0afc3ce3-6bd5-4659-8a47-b63c3e0a0d5d, videothumb3=null, videothumb4=null, videothumb5=null, disabledWYSIWYG=[documentation], wfActionComments=null, title=Table of Contents, reviewInternal=null, sinceVersion=2.0, userLevel=CM,CA,SA,DV,, modUser=dotcms.org.2805, diagram1=null, diagram2=null, diagram8=null, diagram7=null, diagram9=null, file2=null, diagram4=null, diagram3=null, sortOrder=0, diagram6=null, diagram5=null, file1=null, diagram11=null, diagram10=null, lastReview=2012-05-10 23:09:37.48, languageId=1, folder=SYSTEM_FOLDER, nextReview=null, modDate=2012-05-10 23:09:37.497, availableOn=3, wikiTitle=TableOfContents, documentation=<p>Welcome to the dotCMS documentation site. &nbsp;These pages make up a living document, intended to help the dotCMS community to use the dotCMS platform as effectively as possible. &nbsp;If there is something missing, or you would like to contribute to this site, please&nbsp;<a href="/contact-us">let us know</a>.</p>
<h2>What's New in dotCMS 2.0</h2>
<ul>
<li><a href="CustomWorkflows">New Customizable/Extendable Workflow Engine</a></li>
<li><a href="/docs/2.0/FilesAsContent">Files as Content</a></li>
<li><a href="/docs/2.0/MetadataExtractionIndexing">Metadata Extraction/Indexing</a></li>
<li><a href="/docs/2.0/ElasticSearchInDotCMS">ElasticSearch replaces (wraps) lucene for performance and horizontal scalability</a></li>
<li><a href="/docs/2.0/PessimisticContentCheckinCheckout">Pessimistic Content Check-in / Checkout</a></li>
<li><a href="/docs/2.0/ContentEditingUIImprovements">Content Editing UI improvements</a></li>
<li><a href="/docs/2.0/KeyValueFieldType">Key/Value Field Type</a></li>
<li><a href="/docs/2.0/ConfiguringTheDotCMSCache">Configuring the dotCMS Cache</a></li>
<li><a href="/docs/2.0/DataModelAPIImprovements">Data Model/API Improvements</a></li>
<li><a href="/docs/2.0/SearchingWithinAllContentTypeFieldsUsingAll">Searching within all Content Type fields using: _all</a></li>
<li><a href="/docs/2.0/VelocityLogging">Velocity Logging</a></li>
<li><a href="/docs/2.0/RESTfulAPItoManageIndexes">RESTful API to Manage Indexes</a></li>
<li><a href="/docs/2.0/UpgradingTo20">Upgrading to dotCMS 2.0</a></li>
<li><a href="/docs/2.0/AutoUpdater">Auto Updater in dotCMS 2.0</a></li>
</ul>
<p>Looking for the documentation for previous versions? You can find them here:</p>
<ul>
<li><a href="http://dotcms.com/docs/1.9.5/TableOfContents.html">dotCMS 1.9.5</a></li>
<li><a href="http://dotcms.com/docs/1.9.3/TableOfContents.html">dotCMS 1.9.3</a></li>
<li><a href="http://www.dotcms.org/documentation/TableOfContents">dotCMS 1.7</a></li>
</ul>
, owner=dotcms.org.1, inode=d87cb389-faf4-4119-aaac-f8a2d34a2d25, identifier=211e0406-1c2e-4975-9027-3480c2088464, wfActionId=null},lowIndexPriority=false] reason null
[14/05/12 08:52:01:518 EDT] WARN bundlers.URLMapBundler: Bundle Failed: cant get host for com.dotmarketing.portlets.contentlet.model.Contentlet@6e5445be[map={wfActionAssign=null, tag=, videothumb1=null, videothumb2=null, stInode=0afc3ce3-6bd5-4659-8a47-b63c3e0a0d5d, videothumb3=null, videothumb4=null, videothumb5=null, disabledWYSIWYG=[documentation], wfActionComments=null, title=Upgrading to dotCMS 2.0, reviewInternal=1y, sinceVersion=2.0, userLevel=SA,DV,, modUser=dotcms.org.2805, diagram1=null, diagram2=null, diagram8=null, diagram7=null, diagram9=null, file2=null, diagram4=null, diagram3=null, sortOrder=0, diagram6=null, diagram5=null, file1=null, diagram11=null, diagram10=null, lastReview=2012-05-11 00:22:29.63, languageId=1, folder=SYSTEM_FOLDER, nextReview=2013-05-11 00:22:29.63, modDate=2012-05-11 00:22:29.652, availableOn=1, wikiTitle=UpgradingTo20, documentation=<h3>Steps to Upgrade</h3>
<ol>
<li>Download the latest 2.0 zip</li>
<li>Copy your assets directory from your 1.9 series to the assets folder under ./dotserver/dotCMS/</li>
<li>Backup your database</li>
<li>You backed up your database, right?</li>
<li>Create a new db for your 2.0 installation - restore your existing 1.9 DB backup into this new 2.0 db.</li>
<li>If you need to alter any file in dotCMS ie.. ROOT.xml, startup.sh, you should now use the ROOT folder of the com.dotcms.config plugin (which can override any file in dotCMS). For our example, copy your config files and folder structure from your 1.9 tomcat/conf folder into the ./dotserver/plugins/com.dotcms.conf/ROOT directory. For most people, this means you will now have files:<br>
./dotserver/plugins/com.dotcms.conf/ROOT/tomcat/conf/server.xml<br>
./dotserver/plugins/com.dotcms.conf/ROOT/tomcat/conf/Catalina/localhost/ROOT.xml<br>
When you run ./bin/deploy-plugins.sh, the plugin deployer will take these files and override the files in the ./dotserver with the files under the ./dotserver/plugins/com.dotcms.conf/ROOT dir.</li>
<li>cd into the ./dotserver directory, run
<br>./bin/deploy-plugins.sh (or .\bin\deploy-plugins.bat)<br>.</li>
<li>From the ./dotserver directory, start the dotCMS server:
<br>./bin/startup.sh (or .\bin\startup.bat)<br>
dotCMS will run through a number of startup data transformations that will convert your 1.9.x database to the 2.0 schema. If this fails or you see errors in the log see the <a href="#20-db-upgrade">2.0 DB Upgrade Notes</a> below.</li>
<li>Login as you would normally. Go to the CMS Maintenance Tab > Indexes and click reindex</li>
<li>Any questions or comments, please post to the listserv/forum.</li>
</ol>
<h3><a name="20-db-upgrade"></a>dotCMS 2.0 DB Upgrade Notes</h3>
<ul>
<li>
<p>Ensure your DB is UTF8. The upgrade will fail if the tables are not UTF8. If you take a backup, search and see if any tables are encoded with latin1. If so, replace them with UTF8 using something like:
<br/>
sed 's/latin1/utf8/' 195backup.sql >195_utf8.sql
<br/>
</p>
</li>
<li>
<p>Before upgrading, we recommend you deleting your clickstream, clickstream_request, and clickstream_404 tables. These tables are for dotCMS page stats. <br/>
By clean we mean to delete all its data or truncate the table (it can be quicker to drop and recreate the tables).</p>
</li>
<li>
<p>The upgrade process will try to clean up data dotCMS no longer needs by default. For large sites or slow databases, this can take hours. Because of this, dotCMS provides a way to avoid the cleanup, by adding:
<br/>
upgrade-cleanup-bad-data=false
<br/>
to your dotmarketing-config-ext.properties in your config plugin.</p>
</li>
<li>
<p>Some DBs that have used dotCMS for a while can have orphaned data. This orphaned data doesn't affect systems running 1.9.x but it does affect the 2.0 upgrade.
In most cases, the following SQL queries are not required, thought we provide them in case you have trouble.</p>
<h4>We found some older DBs have bad permissionIDs. Run the following to clean them up.</h4>
<pre>
delete from permission_reference where length(asset_id)>36;
</pre>
<h4>Some older databases might have an extra FK on identifier. Try to drop it before upgrade.</h4>
<pre>
alter table identifier drop constraint host_inode_fk;
</pre>
<h4>Sometimes the database can have duplicates uri, host on identifier. Run the following query, if it returns any records you will need to delete them.</h4>
<pre>
select uri,host_inode from identifier group by uri,host_inode having count(*)>1;
</pre>
<h4>Make sure the identifier for the SYSTEM_HOST has an empty uri. Old versions set it to 'host.SYSTEM_HOST'. That makes the upgrade fail.</h4>
<pre>
update identifier set uri='' where inode='SYSTEM_HOST';
</pre>
<h4>Some databases may not have a host inode set for the system folder, in this case check first if yours has a host inode and if it doesn't set to fakevalue</h4>
<pre>
select host_inode from folder where path = '/System folder';
update folder set host_inode = 'fakevalue' where path = '/System folder';
</pre>
<h4>Sometimes inode table can have bad data regarding type field. For example type='folder' but it is for a contentlet.</h4>
<pre>
update inode set type='contentlet' where exists (select * from contentlet where contentlet.inode=inode.inode);
update inode set type='template' where exists (select * from template where template.inode=inode.inode);
update inode set type='file_asset' where exists (select * from file_asset where file_asset.inode=inode.inode);
update inode set type='links' where exists (select * from links where links.inode=inode.inode);
update inode set type='containers' where exists (select * from containers where containers.inode=inode.inode);
update inode set type='htmlpage' where exists (select * from htmlpage where htmlpage.inode=inode.inode);
</pre>
<h4>If you set the data in your config to not clean up here are the queries you can run to clean up the data manually</h4>
<pre>
-- Tree clean up (each one can take several hours)
DELETE from tree where (parent in(select identifier from inode where type='file_asset') or parent in(select inode from folder)) and child in(select inode from inode where type ='file_asset');
DELETE from tree where parent in(select identifier from inode where type='template')and child in(select inode from inode where type ='template');
DELETE from tree where parent in(select identifier from inode where type='containers')and child in(select inode from inode where type ='containers');
DELETE from tree where parent in(select identifier from inode where type='contentlet')and child in(select inode from inode where type ='contentlet');
DELETE from tree where (parent in(select identifier from inode where type='htmlpage')or parent in(select inode from folder)) and child in(select inode from inode where type ='htmlpage');
DELETE from tree where (parent in(select identifier from inode where type='links') or parent in(select inode from folder)) and child in(select inode from inode where type ='links');
Delete from tree where parent in(select distinct host_inode from identifier) and child in(select inode from inode where type ='containers');
Delete from tree where parent in(select distinct host_inode from identifier) and child in(select inode from inode where type ='template');
Delete from tree where parent in(select distinct host_inode from identifier) and child in(select inode from inode where type ='folder');
Delete from tree where parent in(select inode from inode where type='folder') and child in(select inode from inode where type='folder');
Delete from tree where child in(select inode from inode where type='containers') and parent in(select inode from structure);
Delete from tree where child in(select inode from inode where type='htmlpage') and parent in(select identifier from template);
-- Orphan inodes clean up
create table inodeskill (inode varchar(36) primary key);
insert into inodeskill
(select inode from inode where type='htmlpage' and inode not in (select inode from htmlpage));
insert into inodeskill
(select inode from inode where type='containers' and inode not in (select inode from containers));
insert into inodeskill
(select inode from inode where type='template' and inode not in (select inode from template));
insert into inodeskill
(select inode from inode where type='links' and inode not in (select inode from links));
insert into inodeskill
(select inode from inode where type='contentlet' and inode not in (select inode from contentlet));
insert into inodeskill
(select inode from inode where type='file_asset' and inode not in (select inode from file_asset));
delete from permission_reference where asset_id in (select inode from inodeskill);
delete from permission_reference where reference_id in (select inode from inodeskill);
delete from permission where inode_id in (select inode from inodeskill);
delete from tree where parent in (select inode from inodeskill);
delete from tree where child in (select inode from inodeskill);
delete from inode where inode in (select inode from inodeskill);
drop table inodeskill;
</pre>
</li>
<li>
<p>
For dotCMS installs that use different languages we've added a foreign key over contentlet.language_id to ensure it always match language.id. That can fail if you have some contentlets pointing to non-existent languages. To check this run this query
</p>
<pre>select count(*) from contentlet where language_id not in (select id from language);</pre>
<p>If it returns 0 then you don't have to worry about. If not then fix them maybe by setting them all to a single value. Or maybe you would want to see them and decide the language_id for each one.
<br/>To see the problematic contentlet's data run:</p>
<pre>
select * from contentlet where language_id not in (select id from language);
</pre>
<p>To set them all to a single value run:</p>
<pre>update contentlet set language_id=YOUR_VALUE where language_id not in (select id from language)</pre>
<p>Finally you can see your language definition with</p>
<pre>
select * from language;
</pre>
</li>
<li>
<p>All template's identifier uris need to be template.TEMPLATE_IDENTIFIER. Check your identifier table to make sure they are all correct.</p>
<pre>
select * from identifier where uri not like 'template%' and inode in
(select identifier from inode where type='template');
</pre>
<p>If the query returns rows you will need to update them using the following query:</p>
<pre>
/* for postgres and oracle */
update identifier set uri='template.' || inode where uri not like 'template%' and inode in (select identifier from inode where type='template');
/* for mysql */
update identifier set uri=concat('template.',inode) where uri not like 'template%' and inode in (select identifier from inode where type='template');
/* for mssql */
update identifier set uri='template.'+inode where uri not like 'template%' and inode in (select identifier from inode where type='template');
</pre>
</li>
<li>
<p>Having an htmlpage and a folder with same name in the same folder is not supported anymore.
You need to rename either the htmlpage or the folder.
The page or the folder should be renamed to avoid naming conflicts in the new data model. To detect this run this query:
</p>
<pre>
/* for postgres and oracle */
select path as folder,uri as htmlpage from folder join identifier on (path=uri||'/');
/* for mysql */
select path as folder,uri as htmlpage from folder join identifier on (path=concat(path,'/'));
/* for mssql */
select path as folder,uri as htmlpage from folder join identifier on (path=uri+'/');
</pre>
</li>
<li>
<p>
Sometimes folder table can get duplicates. In the upgrade we'll change the data model to avoid that kind of mistakes. Maybe your db can have some. Run this query BEFORE upgrade to list them
</p>
<pre>
select path,host_inode,name from folder group by path,host_inode,name having count(*)>1;
</pre>
<p>
For each case list the dupes. Example:
</p>
<pre>
select * from folder where path='/util/' and host_inode='936f53af-1e05-4e0c-b20c-159fb38d714b' and name='util';
</pre>
<p>
Delete by inode in inode, tree, permission, permission_reference and folder until there is only one row for that (name,path,host_inode) combination. Example:
</p>
<pre>
delete from tree where parent='03d70b48-9733-4f27-bed8-7db94c102f27';
delete from permission where inode_id='03d70b48-9733-4f27-bed8-7db94c102f27';
delete from permission_reference where asset_id='03d70b48-9733-4f27-bed8-7db94c102f27';
delete from folder where inode='03d70b48-9733-4f27-bed8-7db94c102f27';
delete from inode where inode='03d70b48-9733-4f27-bed8-7db94c102f27';
</pre>
<p>
Delete Orphaned Folders
</p>
<pre>
delete from inode where inode where type='folder' and inode not in (select inode from folder);
</pre>
</li>
</ul>
, owner=dotcms.org.2805, inode=4146b440-52db-4102-9df1-929fda5d5e87, identifier=cc10bfe7-2bd7-40e9-b01a-d492b6014702, wfActionId=null},lowIndexPriority=false] reason null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment