Snapshot views of services disabled when Razor plugin is added to ServiceStack.Net in v3.9.45 - servicestack

The snapshot of service data is good to use in development as I first write the service and see if it's returning data and then write the view. However after I upgraded to ServiceStack v3.9.45 it looks like the Razor2 plugin prevents snapshot information being generated. Probably the request never gets that far if there is no view for it.
Is it possible to have the best of both worlds and return snapshot data if there is no defined view? :)

Related

Using Kentico CMS with pre-generated HTML

I have a huge amount of content that is in pre-generated static html pages. I am working with an organization that runs their web site using Kentico (11) on IIS. They wish to host the pregenerated HTML, but to have a consistent look and feel on the pre-generated pages.
Is there a way to includes tags etc inside the pre-generated html that gets kentico to process the content to give the standard look and feel for the website, without having to convert the content (potentially 100k+ pages) to normal kentico content (it just doesn't seem like a feasible approach, since the content is refreshed from the source regularly)
There is definitely no out of the box way to that. I also agree it is not a great approach overall. However, if someone was very determined to make it work and if you really had to, custom programming could make that happen.
You could create some custom logic and use the Kentico API (maybe in a scheduled task if the content is periodically refreshed). The custom code could possibly build out a content tree that is based on the folder structure of the files (if portal), or build out some routing logic (if mvc) to route requests. Those requests that match the ~/filename.html could then be intercepted by Kentico and your custom code, read the contents of that filename.html from disk, and use it as a datasource type of webpart (if portal engine) or a repository / model (if MVC), then use that info to populate the presentation layer of the response of the final html to the browser. That way you could wrap that pre-generated content in a master page with some level of control of what the header and footer look like (if portal engine) or a shared layout (if MVC).
Again, I don't recommend it. It might be very slow and tedious to attempt as well as have performance and scalability issues.
It could be a cleaner approach to somehow get that content into a SQL database and then use standard programming to deal with it in the Kentico layer / website.

PowerBI Embedded API functionality

I have some queries about the PowerBI Embedded API, and more so if functionality exists, and if so where can I find it.
In particular, I am looking to find, from the APIs (PowerBI, Embedded or Azure) where I can complete the following functions:
View the number of Rendered Views within a Workspace Collection
Delete a report/import which has been uploaded
Ability to find out how many renders a single report would create - I would find this especially useful given it is billable per render.
Additional functionality I am looking for, is also to be able to save the rendered chart to image or pdf and responsiveness in the dashboards.
I do realise its still in public preview, however, has anyone managed to find the above functionality within the current APIs.
Thanks
David
View Number of Rendered Views within a Workspace Collection:
Make a POST request to the following ARM API with Content-Length: 0:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/billingUsage?api-version=2016-01-29
Delete import:
Make a DELETE request to the following Power BI API:
https://api.powerbi.com/beta/collections/{workspaceCollectionName}/workspaces/{workspaceId}/datasets('{datasetKey}')
There is no API for this yet.
Consider making the suggestion at https://ideas.powerbi.com/.

Pulling in external content from within CouchDB view

Does CouchDB allow you to call an external web service from within the definition of your view? I basically want to resolve a woeid (where on earth id) using Yahoo's API's and update a view accordingly.
No, you cannot. The reason is that view indexes need to be completely self-contained. Using any external source would require the view index to be recalculated upon every change of that external resource. (not even to mention that CouchDB has no way of knowing when an external change has occurred.)
For this same reason, you cannot use CommonJS modules in your map/reduce (view) functions, as the server would have no way of knowing what changes to any CommonJS modules (in any design document) would have any effect on a given view. The only solution would be to update the view every time a change is made to any design document, which nobody would ever want.
I would recommend you look into GeoCouch for utilizing positioning in your project.

Has anybody ever tried to screen scrape data from sites built with SharePoint?

Or at least could anybody point me to docs about its crazy proprietary url parameters and html field name obfuscation? I can only suppose this is caused by SharePoint...
The main problem is, given a start page built with SharePoint, I can't recreate a form post with a programmative client because:
field names vary, they are appended with a some sort of id, hash, whatever (I think session.wise? Not sure)
tracing HTTP traffic on my side, I see the HTTP request is packed with strange parameters like __REQUESTDIGEST, __VIEWSTATE, and many others
Is this an intentional protection device put up by SharePoint? Which is the underlying architecture and which objects are involved (script callbacks, ... )?
(BTW, I'm not doing anything evil, just trying to extract public government data from a website).
Thanks.
SharePoint is nothing more than an ASP.NET Application, SharePoint completely Built on top of ASP.NET 2.0.
Being said that __VIEWSTATE is nothing but a Hidden Field that has the View State Information
Coming to __REQUESTDIGEST this is an Intentional Protection, this carries some sort of
securito validation which is called FormDigest
And finally to answer your Question, You will not be able to guess field and stuffs unless you have control to change the sourcecode of the application. Reason why the Name of the fields looks like obfuscated is because those controls are not handwritten but generated by the Code of ASP.NET Engine and parser, Reason field having such a name called Naming Container
One suggestion I would say is that, rather than trying to scraping the screen data, you can try alternate approaches, like each of the List in the SharePoint has the XML Feed inbuilt,try to consume it, if you have access to the site, try to retrieve the information using export to excel etc.
In addition to RSS, SharePoint also has a Web Services interface that you can use to get at and interact with data stored in SharePoint in a programatic way.

Sharepoint: Best way to display lists of non-Sharepoint content with "compatible" UI?

I've built a web part for Sharepoint that retrieves data from an external service. I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.)
I'm aware of the "DataFormWebPart" but was unable to get one working properly. It requires a valid DataSource and I was unable to build one from the results of a web service call... Part of the problem is that my web service wrappers don't expose the XML return info, rather I have a bunch of deserialized objects. There doesn't seem to be an easy way to turn actual objects into a datasource, or populate a "generic" datasource from object data.
I could use an SPGridView to get the same UI, but the grid control doesn't have much in the way of smarts -and- it forces every field into its own column. I'd prefer to render each list item as a single cell with complex rendering (for instance the way that StackOverflow shows its lists of questions.) I'd also like to get as much of the Sharepoint-standard UI as possible, such as the sorting, filtering, and paging controls.
So, first: Has anyone here written a Sharepoint control that does this, and if so do you have sample code to share? If not: am I overlooking some useful control, whether MS-supplied or available in an external library?
Thanks!
Steve
Sharepoint: Best way to display lists
of non-Sharepoint content with
“compatible” UI?
Take a look at the built in sharepoint web controls:
Microsoft.SharePoint.WebControls Namespace
It contains all the controls used in sharepoint. I'd tell you more, but the documentation is very thorough.
Problem with SharePoint is that there are a bunch of different ways to do this. If your data is not changing too often and is not overly large it may be worth considering entering it into a list for display.
If you have the Enterprise licence it may be worth getting your data into the BDC and using it there.
you may have to convert the objects into xml or use the serialised objects with the XML webpart for display. This still has the issue of custom rendering using XSLT.
Here's a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:
Creating a Web Service Connection by Using the Business Data Catalog Definition Editor
http://msdn.microsoft.com/en-us/library/bb737887.aspx
The best way to do this IMO is to make a Web Part. As a Web Part the UI will be automatically rendered to be the same as the theme the site is using (unless you override it) and it will be able to be placed anywhere by anyone with admin privileges.
Tutorial on making a Web Part
Tutorial on packaging and deploying a Web Part
Example Web Part Source Code
You could create a custom web part and use an SPGridView. You say you don't like it, because it forces every field into its own column, but that's not true. You can create a template (ITemplate) for every column and fully customize what's shown inside it, just like you would using a normal ASP.Net GridView. Using this approach I've added the little "New" images right next to a list item's Title, just like SharePoint does itself.

Resources