I'm using this URL to go directly to my document in SpagoBI but it does not work:
http://localhost:8080/SpagoBI/servlet/AdapterHTTP?
PAGE=LoginPage&NEW_SESSION=TRUE&OBJECT_LABEL=DocumentName
It gives me the message that I should log in but i'm already logged in.
Download SpagoBIQbeEngine separately from Downloads page (http://forge.ow2.org/project/showfiles.php?group_id=204) and deploy war file to webapps folder of your SpagoBI installation.
Wait till Tomcat automatically deploys war file and refresh the page
Good luck
use url like one mentioned below
you need to pass username and password along with url
as you can see username and password is visible in URL for security
you can use intermediate servlet to build this url and then url.
http://localhost:8080/SpagoBI/servlet/AdapterHTTP?PAGE=LoginPage&NEW_SESSION=TRUE&OBJECT_LABEL=REPORT_NAME&userId=biadmin&password=biadmin
(only login)
if report contains filter u need to pass filter parameter as well in URL
please see url structure of GET method for better understanding for passing multiple parameters.
&PARAMETERS=report parameters
Hope this helps
Related
I have a requirement to send the folder details in the URL for POST method, some thing like this
http:///{directory}/{filename}
I am using Spring API to create the service. Using #PathVariables to two variables in the URI.
Problem : Directory can have "/" slashes in it.
Now how can I create my API, please help me.
POST http://example.com/api/files/path/to/my/file/filename
Stick a controller on /api/files. Scrape the URL starting after /files. Use that to locate the file.
P.S. This has the potential to be a Very Bad Idea. Make sure you secure the controller to only expose those parts of your filesystem you don't mind random internet strangers to be able to operate on.
I have an application in which I'm trying to implement external configs. This part is working fine. However, now it seems like some of the config settings are being lost.
I am using this setting:
grails.app.context = "/${appName}"
appName is defined in the application.properties file, and was working fine.
as stated above I extenalized my datasource and grails.serverURL settings.
Now when I click my logout link I get redirected to http://myapplication/[:]/j_spring_security_logout
I can replace the [:] with the context and it takes me to the correct url (post logout) but then when trying to log back into the application I get this url.
http://myapplication/[:] in place of the default login url.
EDIT
having added some println statements to my Config.groovy file. It appears to load the Config.groovy file 3 times. The first two times I see what I'm expecting to see, the third time is when it setts the context to [:].
Why is it loading the config three times, and what is it about the third time that is loosing my settings?
To answer my own question. After much debugging and hair pulling I found my answer. It wasn't that the context was being lost after logout. The application was never truly getting the correct settings. (in a sense). There are several plugins that call to the config.groovy file during start up. One of those happened to be multiTenant. When accessing the config.groovy and subsequent external config files ${appName} was no longer in scope, thus tomcat loaded application without trouble using its default conventions. The spring logout then tried to redirect after logout to ${appName} which at the time was an empty or [:].
The solution I found was in the external config file to change my grails.serverURL from
grails.serverURL = "http://myApplication.com/${appName}"
to
grails.serverURL = "http://myApplication.com" + grails.app.name
This allows for the application.properties file to contain the app.name variable and the external config file to use the correct property that I need for the different deployments of the war file.
It may not be the most elegant solution but it solve the issue with the spring logout.
I'm working on a spring web mvc project which allows users to upload files. I am saving these uploaded files out of application context so that they persist across deployments. Saving file is working fine. I want to know the best way to convert the file system path to HTTP url so that it can be saved in the database and also used in HTML resource like etc.
Thanks in advance.
As you want to access a file in the filesystem like a static resource using spring mvc, the answer (taken from here) is to serve the static resources adding an entry like in your servlet context:
Example:
<mvc:resources mapping="/images/**" location="file:/absolute/path/to/the/resource/folder/" />
In this case you store all the files in the same path in the same server using only one resource, then you could only store in the db the filename.
In your html tag you need to use a relative url (being aware of your context, so you could access your file like http://yourhost:port/context/resource/yourfile).
In case you want to store files in a different server then you should add another resource origin (but it must be available as a file system path to the other server), so in that case it would make sense to store in the database a value like "resourcename/filename".
Using the hosted Team Foundation Service at tfs.visualstudio.com, one has the option in a Build Definition to "Copy build output to the server" which creates a zip of the drop folder that can be downloaded over https via team web access. I really need to download this drop automatically, so I can chain input to the next stage in my build pipeline.
Unfortunately, the drop URL is not obvious, but can be created using the TfsDropDownloader.
TL;DR - I can't get the TfsDropDownloader to work, I'm hoping someone else has used this tool or a similar method to succesfully download a drop from https://tfs.visualstudio.com
Using the command line TfsDropDownloader.exe I can do this:
TfsDropDownloader.exe /c:"https://MYPROJECTNAME.visualstudio.com/DefaultCollection" /t:"ProjectName" /b:"BuildDefinitionName" /u:username /p:password
...and get an empty zip file with the correct build label name of the last successful build e.g. BuildDefinitionName_20130611.1.zip
Running the source code in the debugger, this is because the URL that is generated for downloading:
https://tflonline.visualstudio.com/DefaultCollection/_apis/resources/containers/804/drop/BuildDefinitionName_20130611.1.zip
..returns a content type of application/json, which is unsupported. This exception is swallowed by the application, but not before the empty zip file is created.
Is it possible the REST API on Team Foundation Service has changed in some way so the generated URL is no longer correct?
Note that I am using the "alternate credentials" defined on my Team Foundation Service account (i.e. not my live ID) - using anything else gets me TF30063: not authorized.
I got it working by using alternate credentials, but I also had to access the REST API via a different path.
The current TfsDropDownloader builds a URL that looks like this:
https://project.visualstudio.com/DefaultCollection/_apis/resources/containers/804/drop/BuildDefinitionName_20130611.1.zip
This returns empty JSON whenever I try to use it. I'm definitely authenticated, because if I tweak the URL to:
https://project.visualstudio.com/DefaultCollection/_apis/resources/containers/804/drop
I get a nice JSON listing of every single file in the drop, but no zip.
From spying on the SSL traffic to https://tfs.visualstudio.com with Fiddler I saw that clicking the "Download drop as zip" link I can see that there is another endpoint at:
https://project.visualstudio.com/DefaultCollection/ProjectName/_api/_build/ItemContent?buildUri=vstfs%3a%2f%2f%2fBuild%2fBuild%2f639&path=%2Fdrop
...which does give you a zip. The "vstfs%3a%2f%2f%2fBuild%2fBuild%2f639" portion is the URL encoded BuildUri.
So I've changed my version of GetServerPath in the TfsDropDownloader source to do this:
private static string GetServerPath(TfsConnection collection, IBuildDetail buildDetail)
{
var downloadPath = string.Format("{0}{1}/_api/_build/ItemContent?buildUri={2}&path=%2Fdrop",
collection.Uri,
HttpUtility.UrlPathEncode(buildDetail.TeamProject),
HttpUtility.UrlEncode(buildDetail.Uri.ToString()));
return downloadPath;
}
This works for me for the time being. Hopefully this helps someone else with the same problem!
Can anyone guide me for setting up suffix proxy server , so that user can access some specific sites cached in our campus server without doing any configuration in their browsers.
by suffix proxy i mean that if user wants to open http: //en.wikipedia.org/wiki/Proxy_server page then he should enter link:
http ://en.wikipedia.org.CAMPUSPROXY.NET/wiki/Proxy_server (where campusproxy.net is our proxy server) and this requested page can be retrived from our proxy server in place of wikipedia.org
It's a redirect really - your server needs to have a url check that will catch the prefix portion of the url and for this you obviously need unlimited prefix's available from the registered domain URI then it just reforms the uri of the prefix makes the request for the page and then presents it as content to the user - normally you'll also inject a banner at the top of the page also.
so it goes
User - http-get en.wikipedia.org.CAMPUSPROXY.NET/wiki/Proxy_server
your server takes this and creates "en.wikipedia.org/wiki/Proxy_server" via a script or what have you.
CAMPUSPROXY.NET http-get en.wikipedia.org/wiki/Proxy_server
inject the banner code into the webpage via a script or what have you.
probably also modify the html tags and headers to include your prefix proxy info
some knowledge of python - perl or whatever is all you need together with apache or similar server, their are of course scripts out there already but if you do that you'll learn nothing.