Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Chambers 635 posts 1252 karma points c-trib
    Aug 31, 2010 @ 18:56
    Mike Chambers
    0

    xsltSearch in medium trust environments...

    When changing to medium trust I get "Error parsing XSLT file: \xslt\XSLTsearch.xslt" at the front end, and trying to save the xslt file in the developer section of the admin gives

    System.Security.SecurityException: Request failed.
    at System.Xml.Xsl.Xslt.Scripts.CompileAssembly(List`1 scriptsForLang)
    at System.Xml.Xsl.Xslt.Scripts.CompileScripts()
    at System.Xml.Xsl.Xslt.QilGenerator.Compile(Compiler compiler)
    at System.Xml.Xsl.Xslt.QilGenerator.CompileStylesheet(Compiler compiler)
    at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
    at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Security.PermissionSet
    The Zone of the assembly that failed was:
    MyComputer

     

    Any one have a work around?

     

    umbraco v 4.5.2 (Assembly version: 1.0.3891.20719)

    .net 3.5

    windows server 2008 iis 7

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 31, 2010 @ 20:27
    Douglas Robar
    0

    You need to give permission for the site's application pool owner to the %TEMP% folder, which is where the compiled scripts in the xslt will be saved. This isn't an XSLTsearch-specific bug per se.

    For further reading and some background inks, read http://blog.percipientstudios.com/2009/9/21/advanced-xslt-with-net-namespaces.aspx and the comments.

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 31, 2010 @ 20:28
    Douglas Robar
    0

    I should mention, though, that XSLTsearch v3 will move the script block in the XSLTsearch.xslt file to the app_code folder, which will avoid this problem entirely.

    cheers,
    doug.

  • Mike Chambers 635 posts 1252 karma points c-trib
    Sep 01, 2010 @ 16:48
    Mike Chambers
    0

    Thanks for the info, I just moved your script block into an external class library and added to the xsltExtensions.config

    <ext assembly="UmbracoJPT" type="UmbracoJPT.Utils.XSLTSearch" alias="JPT.XSLTSearch" />

    all seems to work in medium trust now.

    I hope this is ok?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 01, 2010 @ 16:56
    Douglas Robar
    0

    That's just fine. Glad you got it working.

    cheers,
    doug.

  • Mike Chambers 635 posts 1252 karma points c-trib
    Sep 01, 2010 @ 17:46
    Mike Chambers
    0

    Thought I had, but then encounted a problem with phrase/multiple word matching... so reversed out back to the original script and set to full trust.. and didn't work as I expected but maybe that is by design?

    I have a document with content of "This template should contain secondary and tertiary headings only" just in a p tag.

    searching on secondary great

    searching on "secondary and teritary"  (in quotes) gives phrase matching results.

    But searching on  secondary and teritary gives no results... not sure if I expected logical searches to be working or not?

    Sorry if that is a silly question but can't see it covered in the pdf documentation... and if no logical searches then shouldn't sans quotes just default also to phrase matching?

    thanks mike

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 01, 2010 @ 17:52
    Douglas Robar
    0

    All searches are "and" searches unless you put them in quotes to get "phrase" searching. Therefore you don't need the 'and' in the second example, though it should have worked just fine as all three words appear in the content.

    I think there may be a bug in the 2.8.1 update that broke multi-word searching when not using the "phrase" searching.

    If so, it is probably a bad xpath when I did the conversion to the new xml schema. Pulling the script block into a dll and medium trust wouldn't effect that.

    Let me look into it.

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft