Service Called when clicking on a document in Content Navigator - ibm-content-navigator

I created a response filter to change the value of our Name property for folder to make it more readable for our users. This all works and it displays fine.
But when the folder is opened or clicked on the name reverts back to what it was before before the response filter did any of it's work.
Is there a service called when a folder is open/when a folder is clicked on single click?
This is currently what I have as my filtered services.
public String[] getFilteredServices() {
return new String[] {"/cm/search","/cm/openFolder","/cm/lock","/cm/unlock","/cm/editAttributes","/cm/continueQuery" };
}
Am I just missing a service here that needs put in? I can't find anything on what service would be called when clicking on an item. Thanks in advance!

I believe it is the openItem that is being called, and it is to retrieve all the attributes of the selected item.
Also, you could figure out yourself by using your browser's network-inspector and observe the request fired at the server after you click the document - really useful!

Related

How to give a url to the page?

I am trying to open a new window with the below code. It opens a new window but it has the url as "about:blank". How to change the this url and give a custom url.
private native void openPrintWindow(String contents) /*-{
var printWindow = window.open("", "PrintWin", false);
printWindow.document.open("text/html","replace");
if (printWindow && printWindow.top) {
printWindow.document.write(contents);
} else {
alert("The print feature works by opening a popup window, but our popup window was blocked by your browser. If you can disable the blocker temporarily, you'll be able to print here. Sorry!");
}
}-*/;
It is empty, because first parameter of window.open method is an empty string. Check some examples here. So it should be something like this:
window.open("https://stackoverflow.com", "PrintWin", false);
From Your code I see You want to open a new window by custom URL with some HTML content inside. You cannot do it this way. If You put some URL, the browser will try to open this URL by making a GET request.
Solution to what You want to achieve is to do it more-or-less the MVC way (please note it is NOT a fully correct MVC solution, just a guidance):
Before You open the window, You need to store a content somewhere (best option is on a server side, but there is also a way to store it on a client side)
Create a new page, accessible via Your custom URL (either a simple HTML or a service, up to Your needs).
You need to write some code in this new page which will retrieve Your content (stored previously somewhere) and present it in this newly opened window.

Stop "?" from being added to URL

I currently have an Angular 2 app where the user can submit a form to create a new item. When the submit button is clicked, it calls a function that sends the data to the server and navigates to a new page when the server confirms that the data has been saved successfully.
My problem comes because the form submission appends the form parameters to the URL. So for example if I had an input named title and submission took me to the route mytitle which is the input for the title field, Angular (or whatever injects the GET parameters) would try to navigate to mysite.com/mytitle?title=mytitle instead of just mysite.com/mytitle. Even adding [ngModelOptions]="{standalone: true}" to all of my inputs still leaves a question mark with no parameters after it.
This is a problem because it causes Angular to reload the app because the given route does not match any routes in my route definitions. Is there a way to disable the GET parameters being injected into the URL entirely? POST doesn't work either because I have nowhere to post to, and my next URL uses data from the form itself.
I found an answer to my question, the "Submit" button defaulted to being of type "submit", so changing it to type "button" removed the GET parameters injection behavior.
Check setValue in your form control. Example: Set value this way this.form.controls['val'].setValue='' rather than assigning an empty value
(i.e. this.form.controls['val'] == 0).
If your problem still exists, kindly add button type submit to the button and manually give the click function access to it.

BVN.404Handler. Adding redirect suggestions automatically from EPiServer scheduled job.

I am using a scheduled job that moves outdated events to a folder called "Past events". After the event have been moved, I want to change the event page's url from its old one to the new so it matches the hierarchy of its new location. For this, I am using a custom redirect gadget called BVN.404Handler.
if(Configuration.Logging == LoggerMode.On && Upgrader.Valid)
{
Logger.LogRequest(urlNotFound, referer);
}
The line of code above only logs a suggestion of the old url and the new one.
Since this is a scheduled job that moves pages based on their endDate value i need to make the redirect gadget register the url mappings automatically. With the current solution, a user needs to manually open the gadget and confirm the mapping by pasting the newurl (known referrers) value into the textfield and pressing "Add".
This is what it looks like:
Image of BVN.404Handler gadget
Is this possible to achieve with the current version of this gadget?
<package id="BVN.404Handler" version="3.1.2" targetFramework="net45"
Or do anyone know a possible workaround for achieving this?
Thanks in advance
/ Carl
This is code fragment that Gadget uses itself to store custom redirect:
new DataStoreHandler().SaveCustomRedirect(
new CustomRedirect(oldUrl.Trim(),
newUrl.Trim(),
(skipWildCardAppend == null) ? false : true));
You can give it a try and fill in with your own required data.

Why cannot I create page using scaffold in CQ5?

I create scaffold in cq5. I see it in my miscadmin by this url
miscadmin#/etc/scaffolding/myfirstscaffold
I fill fields - but page doesn't create.
How to know why?
when I click on button1 I don't see result
With the given info, the only issues which i can guess of is,
The template cannot be used under the configured path.(Check for the allowedPaths property and see if it is ok to use with your configured path).
The name property for your textarea i.e., "It's my jcr:content" field. Make sure you specify the name as a relative path from the page node.
i.e., in case you want to store it as a property called "foo" in "jcr:content" then provide the name as "./jcr:content/foo" and not as "./foo"(which is how we generally provide the value for the property "name" for widgets in the components dialog). Else ConstraintViolationException may be thrown.
Even you find that the issue is still there, then check the network tab in devtools(F12) and provide the response for the POST request to /content/home/en/*
I'm guessing the problem could be with the target template you have chosen.
Try debugging by pressing F12 and look for any error during the sling Post operation when u hit create.

MOSS All Groups does not show pagination when more than 100 groups returned

When I go to /_layouts/groups.aspx in my site collection, I only see the first 100 groups. There is no pagination control visible. How do I correct this, to work with more than just the first 100 groups?
You can also modify this view through the standard UI, rather than using code if you need to:
Browse to "http://<site collection url>/_catalogs/users/AllGroups.aspx"
Site Actions-> Edit Page
Modify the List View web part
Under Selected View click the "Edit the current view" link.
You can now edit the view settings like any other in SharePoint.
That list is a sharepoint internal list which cannot be accessed through the API and must be hit by utilizing the object model.
Assuming you're familiar with the SharePoint API,
You need to access your site programmatically
then access the users and groups list, then access the default view on it, and set it's paging property to true.
static void Main(string[] args)
{
//Access the site
using (SPSite _site = new SPSite("http://myurlwithport:800"))
{
//Substitute the appropriate web if it is not the root
using (SPWeb _web = _site.RootWeb)
{
// This is always the name of the users list
SPList userList = _web.Lists["User Information List"];
//This is the view that is causing you trouble
SPView allGroupsView = userList.Views["All Groups"];
//Set this value to true if it is false.
Console.WriteLine(allGroupsView.Paged);
//Set this value to whatever you want if you don't want paging
Console.WriteLine(allGroupsView.RowLimit);
Console.ReadLine();
}
}
}
Hope this does it for ye.
EDIT
Based on OP comments
There is a RowLimit property that you can change instead if you want.
I've added it into the code provided.
I want to share some additional clarification to Michael M's suggestion on updating the "AllGroups.aspx".
Initially, I used a regular Site Collection admin account to access the
"http:///_catalogs/users/AllGroups.asp" page and got access denied.
I then used another Site Collection admin account who's also in the Windows admin group for the SP server and still got access denied.
Finally, I used the SharePoint 2010 Farm admin account that we used to setup the Web App/App Pool, and that finally gave me access to the page.