I am trying to set up dynamic per-item menus (Edit Control Block) in SharePoint 2007. My goal is to have certain features that are available based on the current user's group membership.
I know that the CustomAction tag that controls the creation of this menu item has a Rights attribute. The problem that I have with this is that the groups I am using have identical rights in the site (ViewListItems, ManageAlerts, etc). The groups that we have set up deal more with function, such as Manager, Employee, etc. We want to be able to assign a custom feature to a group, and have the menu items associated with that feature visible only to members of that group. Everyone has the same basic site permissions, but will have extra options availble based on their login credentials.
I have seen several articles on modifying the Core.js file to hide items in the context menu, but they are an all-or-nothing approach. There is an interesting post at http://blog.thekid.me.uk/archive/2008/04/29/sharepoint-custom-actions-in-a-list-view-webpart.aspx that shows how to dynamically modify the Actions menu. It is trivial to modify this example to check the users group and show or hide the menu based on membership. Unfortunately, this example does not seem to apply to context menu items as evidenced here http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/c2259839-24c4-4a7e-83e5-3925cdd17c44/.
Does anyone know of a way to do this without using javascript? If not, what is the best way to check the user's group from javascript?
There are two different Javascript functions that you can implement for dynamically adding menu items to list item drop downs. Core.js (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\CORE.JS) checks for the existence of these methods when generating the menu items for a selected list item. "Custom_AddDocLibMenuItems" and "Custom_AddListMenuItems" are the names of the Javascript methods.
One article that I think you can use to solve your specific problem, dynamic menu item customization based on user role membership, can be found here:
MSDN: Customizing the Context Menu of Document Library Items (note the process is exactly the same for any list type)
This article outlines how server side code can be executed to define the menu items that will be displayed:
[...] in more complex cases, you must retrieve the list of available commands from the server, because only there you can run your business logic and perhaps get the commands from a custom database. Typically, you want to do this if you are implementing a workflow solution where each document has its own process state, with commands associated to it.
The solution for this situation is to have the Custom_AddDocLibMenuItems dynamically call a custom ASP.NET page. This page takes the ID of the document library and the specific item on the query string, and returns an XML string containing all the information for the commands available for that particular document. These commands are available according to the document's process status (or some other custom business logic). [...]
Unfortunately this is not possible to accomplish without using javascript. The ECB doesn't render server controls defined as a custom action (unlike the SiteActions etc).
To learn how to accomplish this by using Javascript check out the following article:
http://www.helloitsliam.com/archive/2007/08/10/moss2007-%E2%80%93-item-level-menus-investigation.aspx
Related
BLUEBEAM AND ADOBE ARE BOTH PDF VIEWERS THAT HAVE A LOT OF SIMILARITIES
Hello, I am trying to figure out how to link a form answer to some markups (tools).
Custom Columns that are created In Bluebeam:
When I create a new tool I can manually fill out all of these custom columns under the "Custom" section within the settings of a tool:
Then I can save that tool and all of the data will be repeated for every copy of that tool. However, the circled columns in the first picture would be changing on every page. Which means I would have to make a new tool for every page. (FYI I would be making ~20 tools for this, so I would have to update 20 tools every single page ;_;) Therefore, I want to create a dropdown/textbox on each page with those columns. When a user fills out the dropdown/textbox, the markups are automatically updated with that info, which means the custom columns are also updated.
Does anyone have an idea of how to link these?
As of now I have been able to create a code that creates a popup if a user selects a certain drop down. This shows me that you can grab the data from a user. I just don't know how to connect that data to all the markups (tools). I know each markup has a special ID, but I'm curious if you can somehow link to the tools "subject" property to do this.
Bluebeam provided me with their JavaScript API if that is any help.
https://i.stack.imgur.com/yEdU1.jpg (I got this image from this post JavaScript Library with Bluebeam)
UPDATE
I found another document with potential accepted scripts for Bluebeam. Please note this one will require people to have Bluebeam Revu eXtreme
https://support.bluebeam.com/wp-content/uploads/2019/08/Bluebeam-Script-Reference-2018.pdf
This version actually has a markup section (which are the things I am more or less wanting to have the custom columns be updated for with the user input)
This document seems to be relevant only for the Bluebeam Script Editor. You can open it by looking in the folder for Bluebeam from your start window.
There are 2 issues I have with this though. I haven't figured out how to run the codes I have in the script inside of Bluebeam yet and I am curious if there is a way to not need the markupID's and/or a way to get them without having to download the markups
I've been lurking on stack for so long, I finally have something to contribute...
I work with custom columns and toolsets all the time. I think you're missing a basic understanding of what the markup list is. Or maybe I am. The markup list is the table of data at the bottom of Bluebeam, where you're trying to change column headings.
The markup list is basically a table of data, what you're trying to do will change the column headers per page, which would change it for all entries. From what I know about Bluebeam, these are static, just like any database or table in any application like Excel. If you need to have different column headings, you need to just stack them all and use what you need on each page or from tool to tool. Or create different profiles with different custom columns, but this gets messy having multiple profiles accessing a single document. Maybe java can help show and hide these per what's relevant on the page within the custom field. But... I think the java is limited to be used within PDF form fields and some basic PDF actions such as print, save, etc. I don't think the level of coding you're looking for exists within Bluebeam.
I use profiles to manage custom columns per process, not the actual tool. It's kind of unclear exactly why the custom columns can follow the tools without the actual profile though.
What I do to accomplish complex tasks is export the markup list and build something within Excel VBA to tabulate data and export reports with relevant information. I'm sure you could use basically any coding language to accomplish this after the table is exported from Bluebeam.
My company just bought a third party application which is based on the ext js 4.2. framework.
The software is closed source, but it is web based such that I can add a .js file to change the UI to my needs.
I want to add some controls to the rendered page. The software is showing IDs everywhere instead of text.
Example: "Issue created by: ID123". When I hover the field is get "ID123. John Doe". Ok, I am a JS ninja, so I can just add a field to the HTML DOM which will display "John Doe"in the correct spot.
I looked at the HTML code to get the correct control and see the the IDs are generated. The code I would write is prone to break with each new release of the third party software.
Now, since the is an Ext JS application I can probably solve the issue much more elegantly like adding a field not to the DOM directly but to the Ext JS container.
Question:
In Javascript I have a reference to the Ext JS app. How would I access the current view or viewmodel or model to query data and add a field?
Rough idea/Pseudo code:
var id = app.getCurrentModel.getValue("creatorID");
var name = myserver.getPersonData(id).name;
app.currentView.addLabelControl(name);
I googled a lot but all examples I found assumed that you are writing the ext js app and you are already in the controller or the view. But I only got the reference to the app.
Sorry for the newbie question :)
"App Inspector for Sencha"
For a quick glance over component hierarchy, you can use the Sencha browser plugin,
Find a certain ExtJS component programmatically
To quickly search ExtJS components or transform your findings into code, your main tool will be the browser console and the command Ext.ComponentQuery.query(xtype), e.g.
Ext.ComponentQuery.query("grid")
Ext.ComponentQuery.query("panel")
Ext.ComponentQuery.query("form")
You will then find in browser console an array of all components of that type. Select the right one, and check whether it has an id or itemId that is not auto-generated (everything like xtype-1234 is auto-generated). For form fields, the name attribute could be useful. Commands like
Ext.ComponentQuery.query("[itemId=ABC]")
Ext.ComponentQuery.query("[name=DEF]")
Ext.getCmp(id)
are far more readable and not as prone to side effects as Ext.ComponentQuery.query("panel")[12].
Most of the time, it can also be useful to think in tree structure. If you want a certain container which contains the only slider you see, trying
Ext.ComponentQuery.query("slider")
Ext.ComponentQuery.query("slider")[0].up()
could be easier than sifting through dozens or even hundreds of containers. Ways to traverse the component structure include up(xtype), down(xtype), nextSibling(xtype), previousSibling(xtype). If an xtype is provided, the next component of the corresponding xtype is selected; if it isn't provided, the next component is selected regardless of the type (e.g. direct parent, adjacent sibling).
Change anything you want.
You can extend, debug or modify any existing behaviour, including but not limited to ExtJS's own code, using a so-called override over any component, including the views or stores that make up this app. override makes a great search term for further information.
Or you can add new components to existing components, like a button to an existing form, from outside the app. For example, open sencha docs and then insert in console:
Ext.ComponentQuery.query("searchcontainer")[0].up().insert(1,{xtype:'button',text:'Test',handler:function(){Ext.Msg.alert('Test Button clicked');}});
You should then find a button on the top left, right of the Sencha logo. Click it.
Find existing controllers
For this, you have to find the name of the app namespace.
If it is e.g. MyApp, then MyApp.app.controllers.items contains the list of controllers. Controllers contain control logic, and the mapping between the components and the logic. When components are created, controllers attach their events to these new components. Many changes can and should be made in the component layer, because controller overrides are messy.
Find viewmodels
You're already done, ExtJS 4.2 does not support them.
Changing models
If you want to change models, be cautious: There is no supported function to add fields to a model. You can override the model prototype, and push more entries into the fields array. But if you have any model instances (records) already running around by that time, they are not updated and any existing warranty is voided.
That said, you find them in MyApp.model. You can e.g. get all fields of the Sencha Docs' Comment model using Docs.model.Comment.prototype.fields, or even push another field in.
What I'm trying to do it's, i think, kinda complex, but i've spent hours trying to find the right documentation, about the interfaces I need to achieve this with no luck:
I need VS write some javascript code and insert it in a certain folder, starting from:
Right click action, on a file from an already created project.
A window it's open that gets information about the functions from
that class in that file that i've right clicked. Besides, it should
have a dropdown, with all the names of classes that reside under a
certain folder.
If I select an item from this dd and press the "ok" button, the IDE
should write some code, using the properties of this selected class,
and the functions from the right-clicked file, as information, to
create the javascript file and save it into the project on a certain
folder of it.
I've achieved some parts of this process:
I know how to create an option into a context menu, using the
initialize function.
Partially, I know how to create new files in a project.
I know how to create a window tool and almost all the interfaces that
are needed for what I want to achieve (make dropdowns and that kind
of stuff).
But the critical part is managing the already created classes and gather info from them in the manner I need.
You can use Visual Studio Code Model to gather info from existing classes.
Following on from my previous Dynamics CRM question (Show popup/alert if account has related entity records)
In the OnLoad event of the Account form, I want to set the window to open with a specific sub-navigation item loaded into the right-hand frame.
For example, by default, when you open the Account window, it loads the account details. Listed on the left are various related items. I have a custom related entity called Alert. If a specific criteria is met in my javascript, I want the Alert entity view to be loaded into the right-hand view instead of the Account details.
Is this possible?
Solved it by using Xrm.Page.ui.navigation.items.get("navItemName").setFocus();
I can suggest three approaches
Approach 1
1. add a tab>section>subgrid to show that associated view
2. use form.onload javascript to show/hide that tab depending on criteria
Approach 2 (probably unsupported)
1. use form.onload javascript to .click() the navigation link [you can take the associated entity name in webresource function parameters to make this a generic library]
Approach 3
Have you considered custom forms in CRM 2011?
Im making an FTP client, which will rely a lot on javascript.
When browsing through the files, you can navigate using the arrow keys. I add a class of .selected to the currently selected filename, but how can I make this clear to screenreaders? How do I make them focus on the current filename?
Would the best way be to make every filename an anchor, which will get the focus when the filename is selected? And also, where can I find a good guide on web application accessibility? I know the W3C has a checklist for content accessibility, but most of the points there don't apply to web apps.
Simplest way to do this is perhaps to have a series of checkboxes, each with a unique ID, paired with a label:
<input id="chk01" type="checkbox"/><label for="chk01">File1.txt</label>
Using this technique, the input is doing the work of exposing a selected-ness for you, while the label takes care of associating it with the name: when focus goes to the checkbox, the screenreader will automatically read out the associated label text. It's all plain HTML, nothing special required. You're free of course to add in selection coloring on top of this - so long as you keep it in sync with checkbox state.
It may be possible to do something similar with A tags; you can use WAI-ARIA properties to set role="listitem" and aria-selected="true"/"false" as appropriate on the items, with role="list" on the parent container. A screenreader will then read these out as list items, rather than links. This technique is more involved, however, and would really need to be tested with an actual screen reader (eg JAWS, or the freely-available NVDA) to ensure it works.
I would suggest you use a javascript framework to help with accessibility in conjunction with WAI-ARIA For examples of accessible jQuery see
https://github.com/fnagel/jQuery-Accessible-RIA/wiki and for examples of accessible drag and drop with WAI-ARIA see
http://dev.opera.com/articles/view/accessible-drag-and-drop/
First - make sure your basics are covered. The Web Content Accessibility Guidelines (WCAG) don't cover interactivity well, but many of its points remain applicable to web applications.
Next - learn about the ARIA standard for Accessible Rich Internet Applications. This will cover a lot of the interactivity you're trying for.
Some relevant links:
http://webaim.org/ for common accessibility problems, plus some invaluable surveys of screen reader usage
http://www.w3.org/WAI/intro/wcag.php - overview of WCAG 2.0
http://www.w3.org/WAI/intro/aria.php - overview of ARIA
There are a number of books on accessibility, which tend to get outdated fairly fast. Sadly, I'm not aware of any book-length discussions of ARIA -- it's still in development. Try reading the specs.
Last but not least -- get a screen reader and learn to use it. Formal compliance with accessibility standards is great, but nothing beats real testing. NVDA is a free and fully featured screen reader that has decent support for ARIA: http://nvda-project.org/
Hope this helps.
When browsing through the files, you can navigate using the arrow keys.
Building upon a previous answer that neglected this feature, wrap the entire widget in a div with role=application. This notifies the screen reader that JavaScript will be used and will allow the user to navigate the widget with the arrow keys while using a screen reader. The excerpt below details how to design the widget to be accessible. Yes, it's not the simplest solution, but it is the most complete. Take your pick.
Description: A widget that allows the user to select one or more items from a list of choices. (listbox). Keyboard Interaction: Tab: When a list is tabbed to, select the first item if nothing else is already selected. A second tab will take the user out of the widget to the next tab stop on the page. Up/down arrows navigate up and down the list. Shift+Up Arrow and Shift+Down Arrow move and extend the selection. Typing letter or several letters to navigate (same letter goes to each item starting with that, different letters go to first item starting with that entire string). Shift+F10: If the current item has an associated context menu, then this key combination will launch that menu. Selection
Checkbox - Space toggles checkboxes, if the list items are checkable Selectable List Items
Space acts as a toggle to select and deselect the current item. If previous items have been selected, it also deselects them and selects the current item. Shift+Space selects contiguous items from the last selected item to the current item. Ctrl+Arrow moves without selecting. Ctrl+Space selects non-contiguous items and adds the current selected item to all previously selected items. Ctrl+A - It is recommended a checkbox, link or other method be used to select all. The Ctrl+A key could be used to provide the shortcut key.
It is recommended the developer use different styling for the selection when the list is not focused (hint: non-active selection is often shown with a lighter background color). WAI-ARIA Roles, States, and Properties: The listbox container has a role of listbox.Each entry in the listbox should have a role option and should be DOM children of listbox.If is not a DOM child of listbox, then it should be referenced in the listbox by aria-owns.If all items in the listbox are not DOM children of the listbox, then set their aria-setsize and aria-posinset accordingly; otherwise, this information cannot be computed for context by the user agent.If the listbox is not part of another widget, then it should have a visible aria-label referenced on the listbox by
aria-labelledby.Each selected list item should have aria-selected="true".
Examples:
Single select listbox
Listbox in an iframe
Refer to the authoring practices for accessible widgets for examples and more information.
From what I understand, YUI has a large amount of support for ARIA.
See:
http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-a11y
Make sure your solution conforms to ARIA:
http://www.w3.org/WAI/intro/aria.php
HTH