Azure DevOps: How to show wiki pages in own application without the devops main menu? - url

I'd like to show the Azure DevOps Wiki I created for my project within a WPF View with a Browser control. I used the following url:
https://dev.azure.com/xxx/xxx/_wiki/wikis/KIS.wiki?wikiVersion=GBwikiMaster&pagePath=%2FNew%20Features&pageId=1
Is it possible to show only the Wiki, without the DevOps main menu on the left side (Overview, Summary, Dashboards, Wiki, Repos, Pipelines, etc.)?

Is it possible to show only the Wiki, without the DevOps main menu on
the left side (Overview, Summary, Dashboards, Wiki, Repos, Pipelines,
etc.)
As you can see from this link, this is the link which represent the whole page contained the left panel and right content displayed. If you want to use this link as the part of your WPF view, it may not be shown only wiki.
But there has an work around, since WPF support Markdown language, you can use the below api to get the its markdown script:
https://dev.azure.com/{org name}/{project name}/_apis/wiki/wikis/{wiki name}/pages/%2F10
And then, use these to used into your WPF script.
Update:
To use this API, you need to pass the credential to the script first. To supply the credential, you can link a .cs file which written with C#.
In this .cs file, use the follow C# script to get connect with your org:
var url = new Uri("https://dev.azure.com//{org}");
VssCredentials cre = new VssCredentials(new Microsoft.VisualStudio.Services.Common.VssBasicCredential(string.Empty, "{PAT token}"));
var connection = new VssConnection(url, cre);
var workitemClient = connection.GetClient<xxxxHttpClient>();

Just wanted to share what we finally ended up with for our WPF "WikiView" user control:
we use the WikiHttpClient's GetPageAsync() to get all pages' content (page.Page.Content) and save the markdown (*.md) files locally using the path name in page.Page.GitItemPath
we use the GitHttpClient to get all images from the "attachments" folder within the wiki repository
Markdig to convert the markdown to html (and manually fix absolute link addresses to relative ones)
a ListBox for the wiki pages (table of contents)
a CefSharp browser control to show the html (the WPF BrowserControl displayed images too small)
I will supply some code in case that's of interest.

Given that the wiki is actually markdown, you can always download the source and use a markdown viewer. E.g. VsCode markdown preview.

Related

VSCode extension IPC with UI inside HTML preview

I wish to develop a unit test runner extension for VSCode. The extension should display discovered tests grouped into expandable hierarchy, annotate run status, display output and errors for each test, provide run/debug commands on different levels, and of course the red/green bar.
Roughly spearating this into "model" and "view", I plan to implement the model in the extension process, and I plan to implement the view as HTML preview based on a TextDocumentContentProvider. (Is there a better approach?)
Now, the model and the view should communicate with each other. I want to implement the view as a single-page application. The view will send commands to the model, and the model will send events to the view (or the view will poll the model for events). The view will update itself according to received events.
My question is, what communication technique should I use? Can HTML page inside the HTML preview access VSCode/Atom/Electron/Node APIs? Can I share object instances, or do some lightweight IPC? By far I didn't figure out.
I've found that I can invoke VSCode commands or refresh the entire page, when the user clicks a link with href set to specific scheme (command:// or the one I registered for my TextDocumentContentProvider).
I do succeed to open an HTTP listener (http.createServer) in the extension process, and communicate through XMLHttpRequest on the HTML preview side. But it looks to me like a heavy overkill.
I wonder if there are more appropriate ways to do this?
Almenon is referring to the currently proposed Webview API that was released in version 1.21 (Feb 2018). For the time being, this appears to be a much better approach for HTML previews. But in order to use the API, there are special instructions. From the release notes:
These APIs are still proposed, so in order to use it, you must opt into it by adding a "enableProposedApi": true to package.json and you'll have to copy the vscode.proposed.d.ts into your extension project.
What isn't clarified (and probably should be) is how to add the downloaded declaration file to a project. One way to do it is place the file in $/node_modules/vscode, next to vscode.d.ts, which is generated during postinstall. Then add the following line to the top of vscode.d.ts:
/// <reference path="vscode.proposed.d.ts" />
That will link the type declaration files. To make this part of the installation process, write a build task to do it and then call it in the vscode:postinstall script in package.json.
VSCode has a new API that makes this easier.
https://github.com/Microsoft/vscode/issues/43713
You can find the new API here
To try the new API:
Add "enableProposedApi": true to your package.json
Manually download vscode.proposed.d.ts and add it to your project: https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.proposed.d.ts
Run your extension with the latest VS Code insiders build

Pentaho 5.0.1 CE Adding folder to pentaho-solutions directory

How do I get a folder to appear in the browser after adding it to \pentaho-solutions in Pentaho 5.0.1 CE. The documentation I read does not seem to work with this new version.
1. Create a new directory in /pentaho/server/biserver-ee/pentaho-solutions/.
Use underscores instead of spaces in the solution directory name. Ensure that the directory has the appropriate user
and group ownership to be writable from the BI Platform.
2. Using an XML-aware text editor (or Design Studio), create a file named index.xmlin your new solution directory.
3. Copy the following text into the index.xml file, changing the content accordingly:
***<index>
<name>Example Solution</name>
<description>This solution contains examples I created while learning to
work with action sequences.</description>
<icon></icon>
<visible>true</visible>
<display-type>icons</display-type>
</index>***
4. Save the file and close the text editor.
5. Log into the Pentaho User Console as an administrator.
6. Refresh the solution repository cache by going to the Toolsmenu, then selecting the Refreshsubmenu, then
clicking on Repository Cache.
You now have a new solution directory. It will show up in all file dialogues in the Pentaho User Console as well as the
Solution Browser in the left pane.
Every time you add or edit an action sequence to your solution directory, you must refresh the repository cache as
explained above. Each user currently logged into the Pentaho User Console must also refresh their session cache; this
is best done by re-logging into the Pentaho User Console.
I am using Pentaho design studio to develop an xaction sequence script. I followed this procedure:
1. In Design Studio, go to the Filemenu, then select New, and click on Other...in the sub-menu.
The Newwindow will appear.
2. In the Newwindow, click the triangle next to Pentaho, select New Action Sequence Wizard, then click Next.
3. In the File namefield, type hello_world.xaction.
4. Select Hello Worldfrom the Templatedrop-down box, then click Finish.
The wizard will generate the new file and bring you back to the workbench.
5. Click on HelloWorldComponentin the Process Actionssection on the left.
The right side of the screen will change to show the options available for this action: Nameand Message. The
Name field controls the name of the component in the Process Actions list on the left; it doesn't do anything else of
note. The Message field contains the text that will appear on the screen when the action sequence is run. It is prepopulated with %quote, which is a token that represents a quote message in a nonexistent properties file. Pentaho
used to provide properties files for each example, but they have been removed from the standard Pentaho Business
Analytics distribution.
6. Replace the %quotewith a sufficiently inspiring message.
Alternatively, you could create a hello_world.propertiesfile and populate it with the appropriate messages and
tokens, but that has no advantage unless you intend to internationalize this action sequence.
7. Save the file.
You now have a working action sequence that prints a short text message: "Hello, World." plus whatever you typed into
the Message field. The first part of the message is determined by a message bundle packaged with the Pentaho Web
application archive.
To test the action sequence, use the Test tab if you are on Windows or OS X, or log into the Pentaho User Console and
run it from the Solution Browser.
Running the sample xaction fails with
Sorry. We really did try.
Something went wrong. Please try again
or contact your administrator.
I figure this is because pentaho cannot locate the xaction file as specified in the file path when I generate the url from within design studio. The folder I created within the solution directory does not appear in the browser directory list despite refreshing the cache. Any help?
With Version 5 the files and folders are no longer stored in "/pentaho/server/biserver-ee/pentaho-solutions/..."
It is stored now in a jackrabbit repository.
You can create folders and upload files in the user console.
I did mistake after starting biserver 5.2. Unexpectedly i deleted Public folder after configuring to jackrabbit. Now how do i create the folder so that i can see Public and Home Folders.
Sorry for getting back to this question some time later, just in case someone searches something related to Pentaho repositories management with no success, i hope this information can help.
Just to make things more clear, i'm using version 5.2.x and i'm supposing you want to create a new folder on the root directory of Browse Files screen, something that is not allowed on Pentaho5 CE Web Console.
The answers about repository management based on JackRabbit are correct, so the old way we used to configure new "solutions" folders doesn't work anymore. From version 5 on, Pentaho exposes an interesting REST api that allows you doing things not allowed in web console.
For instance, for creating a folder in root directory you should create a http REST PUT request against Pentaho Server (using tools like curl or if you appreciate Google Chrome, something like Advanced Rest Client, etc.) using the following URL:
http://localhost:8080/pentaho/api/repo/dirs/:new_directory_name?userid=admin&password=password
Pentaho repository directory REST api is documented here:
http://javadoc.pentaho.com/bi-platform500/webservice500/resource_DirectoryResource.html
It's worthy to spend some time reading REST API the documentation.

Apache Sling JCR browser required

I've just started learning sling. The biggest problem to me at this stage is to browse JCR repository. Is there any good tool to view what is inside repo, showing resources and all properties?
I need something like this one:
http://blogs.adobe.com/gary/files/2011/05/pic3.jpg
thanks in advance
Hubert
Sling does include a basic explorer that you can access at /.explorer.html
I haven't followed the status of the https://github.com/onflapp/RESTed explorer lately, but that looked quite interesting last time I looked: https://github.com/onflapp/RESTed
There's also http://www.jcrbrowser.org/sling/website/ which I haven't tried in a long time but might be worth looking at.
Another option is Composum, which describes itselfs as a 'Slingified' JCR browser.
]
Some of its additional features ( complete list ) are:
repository tree with configurable filters
node creation / deletion / move / reorder
property manipulation
binary data upload / download
component rendering and asset view
template based queries with history
JSON view, download and upload
ACL view and manipulation
I have a JCR Browser that is Open Source and on GitHub. It uses JQueryMobile and SpringBoot.
http://meta64.com

How to map a TFS item url to something viewable

We are programmatically generating deployment emails, based on the history of changesets and associated workitems since the last deployed build. They look a bit like the build summary info inside Visual Studio (but with many builds combined).
There appear to be useful URLs in the data (like vstfs:///VersionControl/Changeset/205151), but being new to the TFS SDK I do not if/how this maps to a viewable item (e.g. http://tfsserver:port/somepath/...). The build summary links inside Visual Studio are clickable, but are they VS-only links?
If possible we want to include links in the email that open the related item (in a browser?), so I guess I need to know if TFS paths are web-browsable and if so, how?
Suggestions welcomed. Thanks.
This is the uRl i have been using to access work items,
=> http://ServerName:PortNumber/tfs/web/wi.aspx?id=xxidxx
Edit
The format i have specified does work with TFS 2010. It basically generates the path to the work item in Web view. Clicking on this opens the work item in the web view.
As an alternate, you could get a navigatable URL programmatically as well.
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("TFSURL"));
var versionControl = tfs.GetService<ICommonStructureService>();
var projects = versionControl.ListAllProjects();
var myService = tfs.GetService<TswaClientHyperlinkService>();
var myUrl = myService.GetChangesetDetailsUrl(21);
So, the service "TswaClientHyperlinkService" is microsofts TFS hyperlink service. This will generate the url formats for Absolute path, relative path, Path and Query, blah blah.
HTH,
Cheers, Tarun
PS - I hate to be wrong!!! hahaha...
EDIT
And since in your case you have the URI available and you already are using the TFS API, these two lines of code would do the trick.
var testManagementService = tfs.GetService<ILinking>();
var testControllers = testManagementService.GetArtifactUrl(#"vstfs:///VersionControl/Changeset/205151");
This will generate, https://ServerName:PortNumber/defaultcollection/VersionControl/Changeset.aspx?artifactMoniker=205151
HTH,
Cheers, Tarun
The following seems to be the standard url for accessing work items
http://TFS_Name:port_number/WorkItemTracking/Workitem.aspx?artifactMoniker=work_Item_Id
The vstfs links are called "artifact IDs" and are internal data to TFS that is expected to only be consumed by a TFS client. A TFS client will parse that data and determine how to display that data. For a changeset link like you provide, the rich clients will open up a dialog with the changeset details. A web client would translate that link into a URI. And the various TFS libraries are able to provide you more data on this artifact using that ID.
If you wanted to create your own link to TFS Web Access, the strictly proper way to do this is to query some information on the server. Once you have a TswaClientHyperlinkService, you can query for the Web Access URIs for various services, such as view a changeset or view a work item. Some examples are shown on Martin Woodward's blog.
In TFS2012, an additional pcguid URL parameter needs to be present. Here's the new format, extending the good solution given by #TarunArora:
http://ServerName:PortNumber/tfs/web/wi.aspx?pcguid=xxguidxx&id=xxidxx
This blog post describes how to find the pcguid via Visual Studio.
However, if like me you're attempting to use TFS without Visual Studio installed (don't ask!), here's an alternative using the browser-based TFS interface:
Go to "Open Issues"
Click on the button that looks like an envelope ("Send query as an email") in the top right of the work item pane.
Right-click on one of the links in the email and copy the link location
Cancel out of the email without sending it.
Paste link location into a text editor and extract the pcguid value.

SharePoint 2007 Publishing Site

Created a new Publishing site to serve a portal for our division. It contains several custom coded webparts that fetch data from the db and/or RSS feds and outside links.
I found it absolutely dumb that as a owner I'm having to approve my own page. Is there was to turn off this functionality? Or modifying so that only a document library runs through the approval process?
In the edit mode, there is a link "Reminder: Check for Unpublished Items" and if I click it all of my web parts and all the links, pictures, and other contents within these web parts are highlighted with a fat dotted red line. How do I get rid of this since what sharepoint is complaining about is embedded in these webpart?
If I try to create a doc library called "Announcements" I get an error:
"The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Announcements/Forms/AllItems.aspx"
For some reason it does not like the word, as I can call it BuggsBunny and all is fine. Is "Announcements" a key word of some kind in SharePoint? I really need to create a list with this name.
Thanks,
Risho
I found it absolutely dumb that as a
owner I'm having to approve my own
page. Is there was to turn off this
functionality? Or modifying so that
only a document library runs through
the approval process?
You should choose, when you are creating your site, a "Publishing site" template rather than a "Publishing site with workflows". The main difference between these two is the fact that you'll approval workflow on nearly everything activated with the later while the former is free of it but still allows you to activate it if needed
there is a link "Reminder: Check for
Unpublished Items" and if I click it
all of my web parts and all the links,
pictures, and other contents within
these web parts are highlighted with a
fat dotted red line. How do I get rid
of this since what sharepoint is
complaining about is embedded in these
webpart?
Don't know where you are hosting your webpart ressources (style library, document library, image library ? outside of SharePoint ? On the 12 hives ?) but if they are within SharePoint libraries and the content is not published with a 1.0 version available for the readers, you'll have this error. Deactivate the approval workflow or publish AND approve theses items. Please also note that external content will probably trigger this red link, but I suggest you to use a limited "visitor" account to check up the final rendering. The "outlining" is a nice addition but it's not always working as expected, mainly with external content.
If I try to create a doc library
called "Announcements" I get an error:
"The resource cannot be found.
Description: HTTP 404. The resource
you are looking for (or one of its
dependencies) could have been removed,
had its name changed, or is
temporarily unavailable. Please review
the following URL and make sure that
it is spelled correctly.
There is a default annoucement list in SharePoint (with its dedicated template, not sure that you have one provisioned with the publishing template that you picked, that might be a reason why you have this strange error. The default announcements list or its template is not a document library. If you want a document library with that name, and that specific name gives you that error, I suggest that you create a document library called AnnouncementsDocuments and then change its title for "Annoucements", that way the url will be clean of the dreaded name and you'll have the specified title.
For the error message, have a look within the source of the error message page, you might have, in some comments, more information that might help us to help you.
Hope it will help :)

Resources