Hi Andre,
Congratulations, it shows that persistence pays off.
Regarding a writeup, I think that many would find that helpful.
The best place to put it would be in the Manakin theme
tutorial<https://wiki.duraspace.org/display/DSPACE/Manakin+theme+tutorial>
.
Adding static pages
....
2. Cocoon-based method. You could use cocoon to check the url right after
the generation step, and then add in your own static DRI page. This method
requires that all your static pages be expressed as DRI and then transformed
into HTML by your standard theme templates. This method is useful if you
will have lots of static pages that need to be managed, but requires
modifying the cocoon sitemap.xmap.
I think its important to fill in the body of that block with how we just
described for adding the AboutPage.java, since the XSLT alone method makes
it say Page Not Found. I suppose there are XSL tricks to suppress your
custom about page from showing PageNotFound. If you have wiki permission,
you could either fill in the wiki page, or do a writeup on your blog (or
create another wiki page), and we'll link to it from there. I don't have a
preference, other then that we should put it down in writing as opposed to
just having to look through old mailing list messages.
Peter Dietz
On Wed, May 25, 2011 at 11:11 AM, André <[email protected]> wrote:
> It works! Thank you, Peter.
>
> Just as you said, I added to
>
>
> /home/dspaceTeste/dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/BrowseArtifacts/sitemap.xmap
> the tranformer
>
> <map:transformer name="AboutPage"
> src="org.dspace.app.xmlui.aspect.artifactbrowser.AboutPage" />
> and added under the <pipeline>
>
> <map:match pattern="about">
> <map:transform type="AboutPage"/>
> <map:serialize type="xml" />
> </map:match>
>
> Thanks again to Peter, Mark and Hardy for the very valuable help and
> attention.
>
> Would it interest anyone if I wrote a concise guide of the modifications?
>
> Andre Assada
>
>
>
>
> 2011/5/24 Peter Dietz <[email protected]>
>
>> Hi Andre,
>>
>> My patch might not have been perfect, especially if you're starting from
>> 1.7.
>>
>> Check your [dspace]/config/xmlui.xconf, to see which aspects are enabled.
>> https://github.com/DSpace/DSpace/blob/master/dspace/config/xmlui.xconf#L61
>>
>> The patch I sent you patched the sitemap for the artifactBrowser artifact,
>> which in 1.7 is now deprecated, and we use browseArtifacts, viewArtifacts,
>> and searchArtifacts.
>> So although you fixed the sitemap for artifactBrowser/sitemap.xmap, if
>> xmlui.xconf doesn't use it, then the AboutPage doesn't get used. So.. make
>> the same change to the artifactBrowser/sitemap.xmap to
>> browseArtifact/sitemap.xmap.
>> You won't need the customization to artifactBrowser/sitemap.xmap anymore.
>>
>> And I think you should be in business after that.
>>
>>
>> Peter Dietz
>>
>>
>>
>>
>> On Tue, May 24, 2011 at 1:47 PM, André <[email protected]> wrote:
>>
>>> Thanks a lot, Hardy, Peter and Mark.
>>>
>>> I tried following Hardy's and Peter's directions and also studied the
>>> wikis/guides (thank you for the links, Hardy!)
>>>
>>> I still can't figure out how to make it work (page title still "Page not
>>> found", no breadcrumbs and no contents showing)
>>> That's what I've got so far:
>>>
>>> 1) on
>>> [dspace-src]/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser
>>> created an AboutPage.java file, very similar to the one by Peter Dietz,
>>> with the 2 methods:
>>>
>>> addPageMeta()
>>> to make the title and the breadcrumbs:
>>> pageMeta.addMetadata("title").addContent(T_title);
>>> pageMeta.addTrailLink(contextPath + "/",T_dspace_home);
>>> pageMeta.addTrail().addContent(T_trail);
>>>
>>> addBody()
>>> Division division = body.addDivision("about-page", "primary");
>>> division.setHead(T_head);
>>> division.addPara(T_para);
>>>
>>> [ the T_para would be the text content of the page, which should fit
>>> internationalization. ]
>>>
>>>
>>> 2)
>>> [dspace-src]/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Mirage/lib/xsl/core/navigation.xsl
>>> we create the link under <xsl:template match="dri:options">
>>>
>>> <div id="ds-search-option" class="ds-option-set">
>>> <a>
>>> <xsl:attribute name="href">
>>> <xsl:value-of
>>> select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
>>> <xsl:text>/about</xsl:text>
>>> </xsl:attribute>
>>> <!-- e aqui o label descritivo -->
>>>
>>> <i18n:text>xmlui.dri2xhtml.structural.static.about</i18n:text>
>>> </a><br/>
>>>
>>>
>>> 3) the messages_[LOCALE].xsl files, containing the text of the "About"
>>> page, translated in many languages
>>>
>>>
>>> 4)
>>> [dspace-src]/dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/ArtifactBrowser/sitemap.xmap
>>> --> under:
>>> <map:components>
>>> <map:transformers>
>>> added:
>>> <map:transformer name="AboutPage"
>>> src="org.dspace.app.xmlui.aspect.artifactbrowser.AboutPage" />
>>>
>>> --> and under:
>>> <map:pipelines>
>>> <map:pipeline>
>>> added:
>>> <map:match pattern="about">
>>> <map:transform type="AboutPage"/>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>>
>>>
>>> 5)
>>> [dspace-src]/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Mirage/Mirage.xsl
>>> the override of <xsl:template match="dri:body">
>>> (How should I call for the contents? is that correct?)
>>>
>>> <xsl:when
>>> test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='URI']='about'">
>>> <div>
>>> <h1>Simple ABOUT page</h1>
>>> <xsl:apply-templates />
>>> </div>
>>> </xsl:when>
>>>
>>>
>>> After mvn, ant, tomcat stop, clear tomcat cache, tomcat start: doesn't
>>> work. What am I missing?
>>>
>>> Thank you again for your patience and help!
>>> Best regards,
>>> Andre Assada
>>>
>>>
>>> 2011/5/20 Pottinger, Hardy J. <[email protected]>
>>>
>>> Thanks, Peter, this looks like a cool way to do static pages, I'll have
>>>> to give this a try. Would you consider doing a writeup on the process on
>>>> the
>>>> wiki?
>>>>
>>>> --Hardy
>>>>
>>>> Sent from my iPad
>>>>
>>>> On May 20, 2011, at 5:03 PM, "Peter Dietz" <[email protected]<mailto:
>>>> [email protected]>> wrote:
>>>>
>>>> Hi André,
>>>>
>>>> I'm guessing that your XSLT is good, you're able to modify a page, and
>>>> get your changes to happen. However, if you are adding a new page that
>>>> doesn't exist, you'll get a problem with the sitemap not having a match for
>>>> the new page you created. The sitemaps (there are browseArtifacts,
>>>> viewArtifacts, searchArtifacts) match paths such as community-list or
>>>> handle/**, but not about/ so you'll end up with the error of Page Not
>>>> Found,
>>>> which is when it doesn't match anything.
>>>>
>>>> The way I fix that for custom pages that we add, is to add an
>>>> AboutUs.Java file to generate some basic DRI, and configure the sitemap to
>>>> use that Java file for our about page.
>>>>
>>>> If you build your xsl to create a static page, that partially works, but
>>>> you also have to modify the sitemap<
>>>> https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/BrowseArtifacts/sitemap.xmap#L82>
>>>> to add a rule to match the content you added. If there is no rule for the
>>>> page in the sitemap, then Page Not Found is the exception.
>>>>
>>>> See this gist for a sample of how to do this: <
>>>> https://gist.github.com/842301> https://gist.github.com/842301
>>>>
>>>>
>>>>
>>>> Peter Dietz
>>>>
>>>>
>>>>
>>>> On Fri, May 20, 2011 at 10:33 AM, Pottinger, Hardy J. <<mailto:
>>>> [email protected]>[email protected]<mailto:
>>>> [email protected]>> wrote:
>>>> Hi, here are the missing links:
>>>>
>>>> DRI Schema Reference:
>>>> <https://wiki.duraspace.org/display/DSDOC/DRI+Schema+Reference>
>>>> https://wiki.duraspace.org/display/DSDOC/DRI+Schema+Reference
>>>>
>>>> Debugging XMLUI hints:
>>>> <
>>>> https://wiki.duraspace.org/display/DSPACE/Manakin+theme+tutorial#Manakinthe
>>>> metutorial-Debuggingatvariousstagesofthethemeapplicationpipeline>
>>>> https://wiki.duraspace.org/display/DSPACE/Manakin+theme+tutorial#Manakinthe
>>>> metutorial-Debuggingatvariousstagesofthethemeapplicationpipeline
>>>> (includes
>>>> info on how to see the DRI behind any page) and I was right, it is
>>>> super-simple, do it by... I'm copying from the page linked above):
>>>>
>>>> 1. prepending DRI/ to the beginning of the page url but after the
>>>> context
>>>> path, i.e. http://<manakin-url>/DRI/search
>>>> 2. appending the XML parameter to the end of the URL, i.e.
>>>> http://<manakin-url>/search?XML or
>>>> http://<manakin-url>/search?query=texas&page=2&XML
>>>>
>>>> As long as I'm pasting links for XMLUI theme development, here are a few
>>>> more I've collected:
>>>>
>>>>
>>>> XML How to Guides:
>>>> <https://wiki.duraspace.org/display/DSPACE/XMLUI+How+To+Guides>
>>>> https://wiki.duraspace.org/display/DSPACE/XMLUI+How+To+Guides
>>>> Slideshow: Making Dspace XMLUI Your Own:
>>>> <http://www.slideshare.net/tdonohue/making-dspace-xmlui-your-own>
>>>> http://www.slideshare.net/tdonohue/making-dspace-xmlui-your-own
>>>> Dryad repository's wiki of working notes on the XMLUI:
>>>> <http://code.google.com/p/dryad/wiki/ManakinReference>
>>>> http://code.google.com/p/dryad/wiki/ManakinReference
>>>> How to create a new aspect for XMLUI:
>>>> <
>>>> https://wiki.duraspace.org/display/DSPACE/Create+a+new+aspect+(Manakin)<https://wiki.duraspace.org/display/DSPACE/Create+a+new+aspect+%28Manakin%29>
>>>> >
>>>> https://wiki.duraspace.org/display/DSPACE/Create+a+new+aspect+(Manakin)<https://wiki.duraspace.org/display/DSPACE/Create+a+new+aspect+%28Manakin%29>--
>>>> a fantastic introduction to how DSpace approaches Cocoon development.
>>>> JavaDocs for the XMLUI:
>>>> <
>>>> http://projects.dspace.org/dspace-xmlui/dspace-xmlui-api/apidocs/index.html
>>>> >
>>>> http://projects.dspace.org/dspace-xmlui/dspace-xmlui-api/apidocs/index.html
>>>> -- especially look at the direct known subclasses of
>>>> AbstractDSpaceTransformer
>>>>
>>>> Cocoon documentation, starting with an overview:
>>>> <http://cocoon.apache.org/2.1/userdocs/concepts/>
>>>> http://cocoon.apache.org/2.1/userdocs/concepts/
>>>>
>>>>
>>>> There are also a couple of useful PDFs floating around on the net,
>>>> google
>>>> for "ManakinDevelopersGuide.pdf" and "tdl-manakin-training.pdf", or
>>>> perhaps the original authors can reply with cannonical links to either
>>>> PDF.
>>>>
>>>> Anyone else have helpful info on XMLUI development, send it my way.
>>>> Thanks!
>>>>
>>>> --
>>>> HARDY POTTINGER <<mailto:[email protected]>
>>>> [email protected]<mailto:[email protected]>>
>>>> University of Missouri Library Systems
>>>> <http://lso.umsystem.edu/~pottingerhj/>
>>>> http://lso.umsystem.edu/~pottingerhj/
>>>> "No matter how far down the wrong road you've gone,
>>>> turn back." --Turkish proverb
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 5/20/11 7:27 AM, "Pottinger, Hardy J." <<mailto:
>>>> [email protected]>[email protected]<mailto:
>>>> [email protected]>> wrote:
>>>>
>>>> >Hi, André, I'm sorry I'm not at my main computer, so I can't paste
>>>> >example code or provide links, but the secret to success is going to be
>>>> >encoding your markup in DRI. The title and breadcrumbs links can be put
>>>> >in that way. To see an example, just look at the DRI behind any page (I
>>>> >always forget how, but it involves adding something to the page's URL
>>>> in
>>>> >you browser, look it up in the wiki). There is also an excellent
>>>> >reference on the entire DRI spec on the wiki. If you can, change your
>>>> >whole markup over from straight HTML to DRI, add the markup for the
>>>> title
>>>> >and breadcrumbs, and see if that fixes things for you.
>>>> >
>>>> >--Hardy
>>>> >
>>>> >Sent from my iPad
>>>> >
>>>> >On May 20, 2011, at 7:12 AM, "André"
>>>> ><<mailto:[email protected]>[email protected]<mailto:
>>>> [email protected]><mailto:<mailto:[email protected]>
>>>> [email protected]<mailto:[email protected]>>> wrote:
>>>> >
>>>> >Dear all,
>>>> >
>>>> >We're trying to create some info pages to our XMLUI 1.7.0 repository
>>>> >using the Mirage theme.
>>>> >The problem probably resides in my poor knowledge of XSLT.
>>>> >
>>>> >1) We've sucessfully added links to the side menu, by adding a link
>>>> >inside the <xsl:template match="dri:options"> eg:
>>>> ><div id="ds-search-option" class="ds-option-set">
>>>> ><a>
>>>> ><xsl:attribute name="href">
>>>> ><xsl:value-of select="/dri:document/dri:
>>>>
>>>> >meta/dri:pageMeta/dri:metadata[@element='contextPath'][not(@qualifier)]"/>
>>>> ><xsl:text>/about</xsl:text>
>>>> ></xsl:attribute>
>>>> ><i18n:text>xmlui.dri2xhtml.structural.informacoes.sobre</i18n:text>
>>>> ></a><br/>
>>>> >[etc...]
>>>> >
>>>> >
>>>> >2) We editted the Mirage.xsl overriding the <xsl:template
>>>> >match="dri:body"> with conditionals for handling the call for the info
>>>> >pages eg:
>>>> ><xsl:template match="dri:body">
>>>> ><div id="ds-body">
>>>> ><xsl:choose>
>>>> ><xsl:when
>>>>
>>>> >test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request']
>>>> >[@qualifier='URI']='about'">
>>>> ><div>
>>>> ><h1>ABOUT PAGE - THIS IS A SIMPLE TEST</h1>
>>>> ><p>Lorem Ipsum dolor sit amet</p>
>>>> ></div>
>>>> ></xsl:when>
>>>> ><xsl:otherwise>
>>>> ><xsl:apply-templates />
>>>> ></xsl:otherwise>
>>>> >[etc...]
>>>> >
>>>> >
>>>> >Question 1) Everything is ok, except for the page title. When we click
>>>> >the "Communities and collections" link, the title of the browser
>>>> >correctly shows "Communities", but with our page we get a "Page not
>>>> >found" title, despite the fact that the contents are shown correctly.
>>>> >Even when we include a html page instead of hardcoding it in the xsl
>>>> (eg.
>>>> >see code below), the contents are showing correctly but the <title> of
>>>> >the html appears not to be interpreted.
>>>> >
>>>> ><xsl:when
>>>>
>>>> >test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request']
>>>> >[@qualifier='URI']='about'">
>>>> ><p><xsl:copy-of select="document('./Reference/lib/about.html')" /></p>
>>>> ></xsl:when>
>>>> >
>>>> >
>>>> >Question 2) The breadcrumbs also don't appear when accessing those info
>>>> >pages we've created.
>>>> >
>>>> >
>>>> >Any help will be very much appreciated.
>>>> >
>>>> >Thank you
>>>> >Andre Assada
>>>>
>>>> >--------------------------------------------------------------------------
>>>> >----
>>>> >What Every C/C++ and Fortran developer Should Know!
>>>> >Read this article and learn how Intel has extended the reach of its
>>>> >next-generation tools to help Windows* and Linux* C/C++ and Fortran
>>>> >developers boost performance applications - including clusters.
>>>> ><http://p.sf.net/sfu/intel-dev2devmay>
>>>> http://p.sf.net/sfu/intel-dev2devmay
>>>> >_______________________________________________
>>>> >DSpace-tech mailing list
>>>> ><mailto:[email protected]>
>>>> [email protected]<mailto:
>>>> [email protected]><mailto:<mailto:
>>>> [email protected]>[email protected]
>>>> <mailto:[email protected]>
>>>> >>
>>>> ><https://lists.sourceforge.net/lists/listinfo/dspace-tech>
>>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>>>
>>>> >--------------------------------------------------------------------------
>>>> >----
>>>> >What Every C/C++ and Fortran developer Should Know!
>>>> >Read this article and learn how Intel has extended the reach of its
>>>> >next-generation tools to help Windows* and Linux* C/C++ and Fortran
>>>> >developers boost performance applications - including clusters.
>>>> ><http://p.sf.net/sfu/intel-dev2devmay>
>>>> http://p.sf.net/sfu/intel-dev2devmay
>>>> >_______________________________________________
>>>> >DSpace-tech mailing list
>>>> ><mailto:[email protected]>
>>>> [email protected]<mailto:
>>>> [email protected]>
>>>> ><https://lists.sourceforge.net/lists/listinfo/dspace-tech>
>>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> What Every C/C++ and Fortran developer Should Know!
>>>> Read this article and learn how Intel has extended the reach of its
>>>> next-generation tools to help Windows* and Linux* C/C++ and Fortran
>>>> developers boost performance applications - including clusters.
>>>> <http://p.sf.net/sfu/intel-dev2devmay>
>>>> http://p.sf.net/sfu/intel-dev2devmay
>>>> _______________________________________________
>>>> DSpace-tech mailing list
>>>> <mailto:[email protected]>
>>>> [email protected]<mailto:
>>>> [email protected]>
>>>> <https://lists.sourceforge.net/lists/listinfo/dspace-tech>
>>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech