I'm setting up a web application that should generate the pdf of the selected row from a table. The pdf has a background image ($image.png) that is located in a different folder from the XSL file ($template).
The managed bean get's the template and with a XML generate a PDF.
Path:
bean (ViewController\Application Sources\view\bean)
$image (ViewController\Web Content\resources\background)
$template (ViewController\Web Content\resources\stylesheet)
The only way i was able to get the image was using the absolute path (file:\\C:\some\folder\image.png).
<fo:layout-master-set>
<fo:simple-page-master page-height="29.7cm" page-width="21cm">
<fo:region-body background-image="file:\\\background/image.png"/>
</fo:simple-page-master>
</fo:layout-master-set>
I'm trying to get the relative project path when the project is launched with the Weblogic.
The path to the file starts from the context-root, to get that I deployed the project in the local weblogic, and from the console, I got the context-root.
I'm still not sure of the currect path for my problem, but for the moment i was able to display the image using:
<fo:region-body background-image="url('http://127.0.0.1:7101/context-
root/path/to/img/image.png')"/>
Note:
I now use the 'url' tag instead of 'file:///' tag.
The next step is to get the relative path.
I'd like to thank every one who tried to answer my question.
Related
I just wanted to generate a documentation of a schema with xs3p.
The problem is, as far as I understand it, that the schema is split into several files and that xs3p did not process the include-tags of the master file: The result is a documentation containing only the root element.
What did I do exactly?
I unzipped the xs3p-download into a certain directory
I copied all schema files into the directory
I called saxonb-xslt master.xsd xs3p.xsl >doku.html (under Ubuntu Trusty, if that matters)
Can you give me any help? I assume, there are two lines to solve the problem:
Making xs3p process the include-tags
Integrating all xsd-files into a single one — how would this work?
Thank you in advance!
You have to set the following xsl:param in xs3p.xsl :
<!-- If 'true', searches 'included' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchIncludedSchemas">true</xsl:param>
<!-- If 'true', searches 'imported' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchImportedSchemas">true</xsl:param>
<!-- File containing the mapping from file locations of external
(e.g. included, imported, refined) schemas to file locations
of their XHTML documentation. -->
<xsl:param name="linksFile">xs3p_links.xml</xsl:param>
Your included/imported schemas must have been previously transformed into a my_transformed_included_schema.html file, and you need to define a xs3p_links.xml file in order to assign some imported/included schema to theirs location such as :
<?xml version="1.0"?>
<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
<schema file-location="my-included-schema.xsd" docfile-location="./my_transformed_included_schema.html"/>
</links>
Hope that'll help !
Can I somehow use the same Eclipse plug-in project for both a generated EMF model and the corresponding generated EMF Edit code?
Normally these two components reside in two different projects, the EMF Edit one with the suffix .edit to its name. I find this superfluous, since there is so little code in the Edit project, and it is so closely related to the model code.
I have tried setting both the modelDirectory and the editDirectory Gen Model attributes to (different) directories in the same project, but that seems to lead to endless confusion and build problems. I think maybe the two generation steps overwrite each others project setting files.
After some more experimentation it seems like it works fine to have EMF and EMF Edit generated code in the same project.
The things I had to do to make it work are the following:
Setting the genmodel property modelDirectory and editDirectory to the same directory. Otherwise I got a build error saying "The type ... is already defined in ...".
Setting the genmodel property bundleManifest="false". Otherwise the plug-in ID is overwritten by the generation process.
Apart from this I also set updateClasspath="false" to avoid that the generation process messes around with that.
The automatic updates to the manifest and plugin.xml files seem to be the following:
Set plug-in ID
Add exported packages
Add EMF extensions to plugin.xml
2 and 3 needs to be performed manually if they are desired. That would involve adding entries to plugin.xml similar to these:
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- #generated model -->
<package
uri="somePackage"
class="somePackage.SomePackage"
genModel="model/model.xcore"/>
</extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- #generated model -->
<factory
uri="somePackage"
class="somePackage.someClass"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
I am using VisualPHPUnit and I am trying to organize my tests into suites (due to the fact that Selenium IDE does not export PHPUnit test suites).
I am currently implementing the option of the configuration XML file.
Yet,it is very limiting cause I want to run test suites on demand and not uploading each time on the server a new XML file (aka test suite).
I know that I can create an XML file with many test-suites in it but I would like to run them individually.
As you understand i am struggling towards DontRepeatYourself principle and code reuse.You know..just choose login.php , then the testcase and them logout.php and run them.
Is something like this possible???
Moreover...would it be difficult VisualPHPUnit to parse only one XML file and create a dropdown box of testsuites to choose from and run?
This is my XML file
<phpunit>
<!-- This is required for VPU to work correctly -->
<listeners>
<listener class="PHPUnit_Util_Log_JSON"></listener>
</listeners>
<testsuites>
<testsuite name="TestSuite1">
<file>/var/www/VisualPHPUnit/app/unitTests/Login/Login.php</file>
<file>/var/www/VisualPHPUnit/app/unitTests/CreateCourse/CreateCourse1.php</file>
<file>/var/www/VisualPHPUnit/app/unitTests/Logout.php</file>
</testsuite>
</testsuites>
</phpunit>
actually the PHP formaters are once again available for Selenium IDE. You may want to check this out:
https://addons.mozilla.org/en-us/firefox/addon/selenium-ide-php-formatters/
there are 2 php formaters: PHP_unit and PHP_Selenium
I have a SiteCore instance where the web.config values for media are as follows:
<setting name="Media.DisableFileMedia" value="false" />
<setting name="Media.UploadAsFiles" value="false" />
<setting name="Media.FileFolder" value="/App_Data/MediaFiles" />
<setting name="Media.UseItemPaths" value="true" />
So, this should mean that the item will be stored in the database and not the file system, correct? I ask because they are being stored on the file system, with a path that looks like this:
/App_Data/Replicated/MediaFiles/6/4/E/{64EC628B-9C94-4416-B9BD-5A90EA7D8971}220px-Liliumbulbiferumflowertop.jpg
Does anyone know why that would be? This is a small part of a larger puzzle I'm trying to understand.
I have learned that users can manually specify whether a file should be uploaded as files on the filesystem. I discovered that content editors on a site I have been developing were doing so out of habit based on past sites they had worked on. To prevent users from having this choice, you may set the Upload.UserSelectableDestination setting to false (default is true).
Media.DisableFileMedia is more to turn on or off the option of either storing the media item in SC or on the file system (in the actual SC UI)
Media.UploadAsFiles is used to indicate whether the media items are put in SC (if false) or on the file system (if true) - If you have DisableFileMedia set to true, then this is ignored and considered to be "true"
Media.FileFolder is obviously the location of where to put the files on the file system, should any the above be set to true.
Media.UseItemPaths actually has nothing to do with storing media items on the file system. It simply is a toggle between showing URLs like "~/media/[item id]" vs the full path of the media item.
I have met the same problem. After the 5 hours of investigation, i found that App_config\Include\ScalabilitySettings.config overrides the Media.FileFolder value. So disable the ScalabilitySettings.config and try again. It will store all file in the folder which was specified by the Media.FileFolder setting.
Answer for solving the problem:
disable App_config\Include\ScalabilitySettings.config or change value of Media.FileFolder in this config
I have 3 XSL files which have paths in them to something like C:\templates\Test\file.pdf
This path isn't always going to be the same and rather than having it hard coded in the XSL, I'd like it so that the path C:\templates\test\ is replaced with a tag [BASEPATH] and when I read in the xsl file into the XSLTransform object (yes I know it's been deprecated, I may move over to the XSLCompiledTransform at the same time), I'd like the tag [BASEPATH] to be replaced with the absolute file path of the web folder (or Server.MapPath("~") seeing as it is in .net)
I thought I may be able to make an XSLLoader aspx page which takes the name of the XSL file through the querystring and then returns the XSL file via xml content-type. When I try this, I get a 503 error though so I'm not sure if you can pass urls like this into the XSLTransform.Load method.
Any ideas what to do?
Have you looked at XSL parameters?
<xsl:param name="basepath" select="'C:\Users\Graeme\'" />
<xsl:value-of select="document(concat($basepath, 'test.pdf'))" />
Then, most decent XSLT engines have a way to set a root level parameter from outside.