[MGNLGS-6] Migrate Google Sitemap Module to Magnolia 4.5 Created: 12/Apr/12  Updated: 24/May/12  Resolved: 08/May/12

Status: Closed
Project: Google Sitemap (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2

Type: Task Priority: Neutral
Reporter: Ondrej Chytil Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File editpage-newlook.png     File mainEdit.ftl-patch    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLGS-7 Migrate Google Sitemap Module to Magn... Sub-task Closed Eric Hechinger  
MGNLGS-8 Migrate Google Sitemap Module to Magn... Sub-task Closed Eric Hechinger  
MGNLGS-9 Migrate Google Sitemap Module to Magn... Sub-task Closed Eric Hechinger  
MGNLGS-10 Migrate Google Sitemap Module to Magn... Sub-task Closed Eric Hechinger  
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

Templates are not 4.5 compatible.



 Comments   
Comment by Eric Hechinger [ 20/Apr/12 ]

Concept page created:
http://wiki.magnolia-cms.com/display/DEV/Concept+Google+SiteMap

First implementation done.

Comment by Federico Grilli [ 20/Apr/12 ]

This is how the edit page would look with the patch I am going to attach

Comment by Federico Grilli [ 24/Apr/12 ]

A user on the forum kindly provided this workaround for the multisite issue. I don't know exactly the implementation status and if the problem has been already solved. If not it is worth taking a look at it.

HttpMethod method = new GetMethod("urlforgooglesitemap.html");
method.setQueryString(new NameValuePair[] { new NameValuePair("url", url) });
httpclient.executeMethod(method);
String tinyUrl = method.getResponseBodyAsString();
method.releaseConnection();

String inputLinem = tinyUrl.replaceAll("http://localhost:8080/magnolia//", "www.mysite.com");
inputLinem = inputLinem.replaceAll("cpauthor", "");
InputStream fstream = new ByteArrayInputStream(inputLinem.getBytes());

HierarchyManager hm = MgnlContext.getHierarchyManager("dms");
String path = "/mysite/docroot/seo/";

String label ="sitemap";
String fext="xml";
String tip = ItemType.CONTENT.toString();
tip = ItemType.NT_CONTENTNODE.toString();


Content deletecontent = hm.getContent("/mysite/docroot/seo/sitemap");
Content parentdoc = deletecontent.getParent();
deletecontent.delete();

parentdoc.save();
parentdoc.updateMetaData();


Content thisContent = hm.createContent(path, label, tip);
info.magnolia.module.dms.beans.Document dmsdoc = new info.magnolia.module.dms.beans.Document(thisContent);

dmsdoc.setFile(label,fext,fstream);
dmsdoc.updateMetaData();	

info.magnolia.module.dms.beans.Document.setCurrent(dmsdoc);

Content thisParent = thisContent.getParent();
thisParent.save();
Generated at Mon Feb 12 02:05:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.