Sql Query to XML document inside Drupal - sql

I need to be able to dump my user table inside Drupal to an XML document that I can hit from a path in a browser.
e.g. mysite.com/users.php
Looking for an easy way to do this, an existing module would be ideal. Not sure if QueryPath does this.
Thanks.

Using Views Bonus Pack you can first build a view of all your users, and then create a 'feed' display. In the feed settings, you'll be able to select XML as one of the formats. You can then set the path to anything you like.

QueryPath can do this.
There is a database extension that comes with QueryPath's Drupal module that basically lets you take any SQL statement and inject the results into an XML document. The basic idea is explained here:
http://technosophos.com/content/using-querypath-interact-sql-database-part-1
The Drupal module has Drupal-specific DB bindings though. (So stuff like {table} is correctly translated.)
I've also used the Views Datasource module to do this, but it's buggy. The last two times I did it, I had to edit the source code for the module first.

Related

Prestashop 1.7: Can I use another database just for executing a side script?

I have created a Prestashop website with a database N°1. For some reasons, I want to write a script, that I'll execute a few times and that will simply fill a database N°2 with some data. This script has nothing to do with my Prestashop website, but is part of the same project and then, must be hosted in the same server, and moreover must be present within the Prestashop website's files (under a module directory I've made).
My question is: is it possible to use this database N°2 (only for this script)? Can I use Prestashop's Db.php class to do it?
Don't hesitate to ask for more informations if I'm not clear.
So if i am reading your post correctly you want to create two databases.
For example "prestashop_n1" and "prestashop_n2".
prestashop_n1 contains all prestashop required tables.
prestashop_n2 contains data extracted from prestashop_n1
In order to extracted data from prestashop_n1 to prestashop_n2 you could write a module.
In this module you can create a database connection to database prestashop_n2
You can use PHP to copy data from prestashop_n1 to prestashop_n2
Alternative you can add a cron-job to execute your script for copying data x times a day.

query XML file in a sql script

In HANA, I need information on calculation view like cross client or not, commentary on node, cardinality...
Those information are in XML file of the calculation view. Is it possible to extract it with a procedure?
During my research I found this : https://archive.sap.com/discussions/thread/3600091
I hoped that now it would be possible.
If you have any idea, please share with me,
Thanks in advance
I'm replying to the question on getting the metadata or attributes from a view. You can probably find these in tables like _sys_bi.bimc_* (e.g. BIMC_PROPERTIES in the _SYS_BI schema), SYS.VIEWS, SYS.VIEW_COLUMNS, SYS.cs_view_parameters (has the client as a parameter) or sys.view_columns.
I think it's easier to extract this information from the automatic documentation file in PDF format from HANA Studio, though, but it depends on what you are trying to do.

How to create pdf Template with the dynamic values

I am stuck in this task from a month ago so my last option is to post my query on stack-overflow.
I have to find a PDF Creation tool where i can crate my PDF Template and also i can assign a data source like sql server or any thing else. by which the sql server dynamic data can replace the value of pdf template Tags.'
I have tried many tools like Foxit and bulzip . But any of the tool does not meets my requirement. I must say I have completely stuck in this Task.
So Please give me appropriate solution . Immediate response will be appreciated.
If you want to create pdf in client side, you can try jspdf
If you are using php for server side, you can try mpdf.
Have a look at wkhtmltopdf. It's a very simple console utility that creates PDF from HTML. So basically you need to generate HTML markup. You can use some scripting language (PHP, python, etc.) or templating engine, depending on what exactly you want and what tools you are familiar with.
Create HTML/CSS markup for your template.
Define places where you want to put dynamic data, mark it
somehow.
Create script that will query database for your data and then
Either use search&replace in your script to place real data, or
copy whole HTML as a template using some templating engine (for
instance, PHP is itself a template engine, so you can basically
place save template as PHP file where real data is placed where
needed).

How do I assign a URL to a file stored in a SQL database?

I have a self-made document management system that stores files of all sorts in an SQL database. The database stores 4 basic rows of information, namely:
FileID
FileName
FileSize
FileType
FileContent
I want to use viewer.JS to preview files, but it requires that I have a URL to access my file, and I have no idea how to assign a URL that would access a file of my choice in a row in a database. I'm building on a home-grown PAAS, thats built on .net.
I've heard that the URL rewrite module for IIS (I'm on 7) may solve my problem, but cant seem to crack it.
Any help on my problem would be much appreciated.
IMHO IIS rewrite would not help you. Assuming you're using .net, you'd need to build a simple website and use routing in a view.
The url could be something like /Document/{fileid}. when this path is encountered, the router would call your view and you can return the file's content.
Store file in SQL Server database using .Net MVC3 with Entity Framework has some info on a model/controller.
Note: There are some security issues with this approach.

Is it possible for Visual Studio 2008 Automatically create XML Comments tags without "Generate XML documentation file" checked (VB.NET only)?

When in VS 2008 if a developer hits the ''' it generates the XML comment tags for you, but this only works when the project setting for "Generate XML documentation file" is checked.
Is there a way to tell VS to generate the XML Comment tags, regardless of the project setting?
I think it is possible that someone may want comments but not create a XML documentation file.
In this case I am exceeding the current Team Settings, yet other developers don't want me to change this project setting. This forces me to flip this back before checking in the project.
I have the same problem with other Project settings like "code Analysis".
This is only a problem for VB.NET projects.
I know this is an old post however I have found a work around that may work for you depending if you team members just want the XML comments functionality and not the XML files.
1) In your project properties ensure that Generate XML documention file is checked.
2) Click the Build Events button
3) Into the Post-build event command line box enter the command
Del "$(OutDir)$(ProjectName).xml"
Now after each build it will remove the XML comment file.
Note: For some reason if it exists from a previous build it will not delete it so manually delete it the first time.
As far as I know, it will always create the xml comments....the Generate XML documentation I think only affects whether those comments are then compiled into an xml file.
Is it behaving like this on everyone's machine?
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=477562
but obviously you already know that since you opened up the Connect issue.
No for VB.NET and VS2008.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=477562