I am creating a menu with the linux utility dialog (see below) and I have heard that it is possible to make a tree-like structure for those checklists. However I cannot find any type in the manpage that creates such a thing? Is it really possible - and if yes: how?
See http://i51.tinypic.com/2ir9qfl.png vs http://i56.tinypic.com/35jasmh.png for how it actually looks like and how it should look like. The original pic was created using dialog --checklist.
First and foremost thank you for the answerz. However the ambiguity of the word 'dialog' and the lack of a correct side by side comparison (couldn't double-check as I was unexpectedly hurried - sorry) made the question difficult to understand.
Hope this helps:
How it looks like: http://i51.tinypic.com/2ir9qfl.png
How it should look like: http://i56.tinypic.com/35jasmh.png
I still want to use the 'dialog' utility - I just want a tree-like view that shows that allows to group some items for better overview. It should be the front-end for a rather complex script that can checkout, compile, fetch and do some other fancy stuff, and the person who wanted me to do this script said that he is sure a tree-like view in dialog is possible as he had seen it before, could however not supply me with the necessary code.
You cannot use the Linux dialog utility to do a single page checklist hierarchy
Instead, create a series of menus to achieve the same semantic structure, far from optimal though, I'll grant you.
The other option is to write a script (in perl/python/ruby perhaps) which uses the ncurses/curses library to build this section of the UI. See here (python example) to help you get started.
Note.
The person who said they had seen a tree like view composed in dialog has either...
Seen it done with a patched/non-standard version of dialog which may exist. (?!)
Saw a custom made ncurses/curses app that provided a similar UI to dialog, hence the confusion.
For more info on ncurses/curses see http://www.linuxselfhelp.com/HOWTO/NCURSES-Programming-HOWTO/
The sample you posted will be difficult to match in formatting, but bash/ksh/zsh all support the select construct, which builds a menu and allows you to process the results of the selection.
PS3="Choose an option "
select opt in start mid end quit
do
case $opt in
start) echo "starting";;
mid) echo "Standing by";;
end) echo "Standing by";;
quit) break;;
esac
done
Example run
1) start
2) mid
3) end
4) quit
Choose an option
1
starting
4
# prompt >
Depending on your requirments, you may need to wrap this a continuous loop, i.e.
while true ; do
select ...
done
I don't think it will be possible to center the question tree as your example.
I hope this helps.
P.S. as you appear to be a new user, if you get an answer that helps you please remember to mark it as accepted, and/or give it a + (or -) as a useful answer.
Related
I would like to ask is it possible to allow user to select multiple values and display dynamic result depends on user’s selection in Domino Designer 9.0.1?
We are required to develop a web application using xpages.
Here is is the background of web application:
Each member has a current group
Each group are required to join some specific activities
Member can choose future group and check the activity is joined or not join
That means use member in current group’s latest activity status (joined or not join) to compare the future group (find which activity is joined or not join)
The sample pictures about the application will be like the following
For user's selection: the user can choose multiple members with related current group and the user can choose the future group for each member for the comparison.
After click the Submit button, the result shows to the user
Here is the question: is it possible to do this in Domino Designer 9.0.1?
The reason we ask is we haven't find similar sample on the internet yet and we don't know whether it is possible to do in the Domino Designer 9.0.1.
Grateful if someone can provide advice on this issue please. Thank you very much.
Update:
We apologize for our misleading question. We are absolutely not asking someone to write code for us.
We are not able to upgrade to Domino 9 at the moment and we are currently writing some code using 8.5.2.
However we have a concern that if we write a lot of complex code in the application, it will be a trouble for our colleagues to do the maintenance for program.
Also assume we write a lot of complex code in the application and the program works, what about if the user has new requirements base on the current function for the program? We believe the code will be much complex and hard for someone who handle this task to understand the logic of the program.
Thus, for the future development and the program maintenance. Is the latest version more flexible to develop and maintain or just not much difference to accomplish.
Sorry for the inconvenience we have made.
Thank you for your time.
Update 2
For the coding of the program, we have the following experiment.
Option Public
Option Declare
Sub Initialize
Print |Content-Type:application/text/html|
Print "<tr><td>Result<br></td></tr>"
Print "<br>"
Print "<br>"
Print "<table border = 1><tr><th>Member</th><th>Test 001</th><th>Test 002</th><th>Test 003</th></tr></table>"
Print "<table border = 1><tr><th>Activity</th><th>Joined</th><th>Joined</th><th>Joined</th></tr>"
Print "<tr><td>Activity 1</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print"<tr><td>Activity 2</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print "<tr><td>Activity 3</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 4</td><td>No</td><td>No</td><td>Yes</td></tr>"
Print "<tr><td>Activity 5</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 6</td><td>No</td><td>No</td><td>Yes</td></tr></table>"
End Sub
Those code just hard code only, it will open in html format.
Due to the data will change depends on user's selection, we cannot guarantee the size of the table and hard to define data to locate in which cell.
We are currently studying how to make those code dynamically, make it more flexible.
Thank you.
The tool you need in XPages are custom objects either in JavaScript or Java (that's way less scary than it sounds) and one repeat control for the rows. If the number of columns are dynamic too, then you need 2 repeat controls.
The layout reminds me a lot of the table walker example (I wrote) as part of IBM's original XPages 8.5.0 training exercises. You need to check them out.
In particular look at Exercise 23. The data source, multi value fields might not fit your case, but the dynamic table does.
Good luck and let us know how it goes.
I was wondering if it's possible to alternate the SetupCompleteSuccess dialog for InstallShield based on certain conditions. As hyperlinks on dialogs only work with MSI version 5.00 and above, I have the following conditions set on SetupCompleteSuccess and SetupCompleteSuccessWithLink
VersionMsi >= "5.00"
and
VersionMsi < "5.00"
The problem I'm facing is that SetupCompleteSuccess appears to have a special sequence order of -1 so I'm stuck.
Thanks
Unfortunately Windows Installer doesn't make this trivial with how their hyperlink control works. This interaction in particular is a bad one.
Here's one approach I suspect would work, but haven't had a chance to try out. In sequence -1, instead of putting the name of a Dialog, put the name of a custom action that chooses between your two alternatives, and invokes the selected one with MsiDoAction or equivalent.
You could use a custom action to emit temporary data into the InstallUISequence table to redirect which dialog is -1 based on VersionMSI.
Personally, I'm of the opinion that people don't really read the dialogs in an installer anyways so I rarely ask questions or tell important information. I'd move the "view website" type requirement to the first run of the application itself.
I'm relatively new to Expression Engine, and as I'm learning it I am seeing some stuff missing that WordPress has had for a while. A big one for me is shortcodes, since I will use these to allow CMS users to place more complex content in place with their other content.
I'm not seeing any real equivalent to this in EE, apart from a forthcoming plugin that's in private beta.
As an initial test I'm attempting to fake shortcodes by using delimited strings (e.g. #foo#) in the content field, then using a regex to pull those out and pass them to a function that can retrieve the content out of EE's database.
This brings me to a second question, which is that in looking at EE's API docs, there doesn't appear to be a simple means of retrieving the channel entries programmatically (thinking of something akin to WP's built-in get_posts function).
So my questions are:
a) Can this be done?
b) If so, is my method of approaching it reasonable? Or is there something stupidly obvious I'm missing in my approach?
To reiterate, my main objective here is to have some means of allowing people managing content to drop a code in place in their content that will be replaced with channel content.
Thanks for any advice or help you can give me.
Here's a simple example of the functionality you're looking for.
1) Start by installing Low Replace.
2) Create two Global Variables called gv_hello and gv_goodbye with the values "Hello" and "Goodbye" respectively.
3) Put this text into the body of an entry:
[say_hello]
Nice to see you.
[say_goodbye]
4) Put this into your template, wrapping the Low Replace tag around your body field.
{exp:low_replace
find="[say_hello]|[say_goodbye]"
replace="{gv_hello}|{gv_goodbye}"
multiple="yes"
}
{body}
{/exp:low_replace}
5) It should output this into your browser:
Hello
Nice to see you.
Goodbye
Obviously, this is a really simple example. You can put full blown HTML into your global variable. For example, we've used that to render a complex, interactive graphic that isn't editable but can be easily dropped into a page by any editor.
Unfortunately, due to parse order issues, EE tags won't work inside Global Variables. If you need EE tags in your short code output, you'll need to use Low Variables addon instead of Global Variables.
Continued from the comment:
Do you have examples of the kind of shortcodes you want to support/include? Because i have doubts if controlling the page-layout from a text-field or wysiwyg-field is the way to go.
If you want editors to be able to adjust layout or show/hide extra parts on the page, giving them access to some extra fields in the channel, is (imo) much more manageable and future-proof. For instance some selectfields, a relationship (or playa) field, or a matrix, to let them choose which parts to include/exclude on a page, or which entry from another channel to pull content from.
As said in the comment: i totally understand if you want to replace some #foo# tags with images or data from another field (see other answers: nsm-transplant, low_replace). But, giving an editor access to shortcodes and picking them out, is like writing a template-engine to generate ee-template code for the ee-template-engine.
Using some custom fields to let editors pick and choose parts to embed is, i think, much more manageable.
That being said, you could make a plugin to parse the shortcodes from a textareas content, and then program a lot, to fetch data from other modules you want to support. For channel entries you could build out of the channel data library by objectiveHTML. https://github.com/objectivehtml/Channel-Data
I hear you, I too miss shortcodes from WP -- though the reason they work so easily there is the ubiquity of the_content(). With the great flexibility of EE comes fewer blanket solutions.
I'd suggest looking at NSM Transplant. It should fit the bill for you.
There is also a plugin called Shortcode, which you can find here at
Devot-ee
A quote from the page:
Shortcode aims to allow for more dynamic use of content by authors and
editors, allowing for injection of reusable bits of content or even
whole pieces of functionality into any field in EE
I have a request form I'm working on, wherein different departemnts need to be able to update it. To minimize overlap and lost changes I'd like to be able to submit data from the new form to different lists, but I cannot find a way to do this.
Does anyone have any experience trying to do anything similar?
If you're familiar with JQuery andSPServices I could envisage a way to do this.
In the EditForm.aspx, add the JQuery and SPServices libraries. using the $.(document).Ready function, I'd do a quick item update with the SPServices and just copy a column with the same data, so in effect no change looks to have taken place. I'd add in the edit comments something like "Pseduo checkout to [name], [date_time]".
Then allow the user to edit the form as normal but in the code you've added, you trap the PreSave Action and check that the person trying to do the save is the same as the last modified - if it is, save as normal, otherwise, return false on the PreSave and it will be denied. When you actually allow the save, set the edit comments to something sensible.
To complete this, check before doing the pseudo checkout, that the last comments don't contain the psuedo checkout phrase so that you can prevent anyone opening/editing the form whilst somebody else is in the middle of an edit.
This gives a cheap and relatievly easy to implement Check-In/Check-Out for a list. Not perfect of course but should work well in most scenarios (not in datasheet though, so you might need to prevent that type of edit).
If you have two lists would you not then have the problem of potentially two requests for the same thing?
Does none of the version control options for the list solve the problem of potentially multiple concurrent editors?
While SPService is certainly a solution, but you will have to build a UI of ur own.
Try writing a event receiver, which can copy over item to another list as soon as it is created.
It will be nice if you can tell why you really want to have a copy of item in another list
i.e. Auditing purpose etc. , you can get a perfect solution for this in Forum
In Cucumber you define steps which define your BDD syntax; for instance, your test might have:
When I navigate to step 3
and then you might define a step:
When /^I navigate to step (\d+)$/ do |step_number|
# navigate to step ${step_number}
end
Now, all of the above works perfectly fine as is (or at least I think it does). However, you can also do this instead:
When I navigate to step "3"
with a regex:
When /^I navigate to step "(\d+)"$/ do |step_number|
In "The RSpec Book: Behaviour-Driven Development with Rspec, Cucmber, and Friends", author David Chelimsky writes "There are two common styles for steps ... Discuss the pros and concs with your team". On my team a few people have already started using quotes, but it makes invoking steps manually more awkward because you have to escape the quotes inside the step step names (when those step names are themselves wrapped in quotes). However, having quotes makes it more clear where variables are in the Cucumber text.
So, what I'm wondering is: is there any sort of community consensus on what the "right" style is here? Or lacking that ...
Has anyone ever done a benefit comparison between the two styles?
Has anyone used either style extensively?
Ideally I'd like to find out as much as I can before we write a million tests with the "wrong" style ;-)
Seeing as no one is replying to you, I decided to comment - maybe you'll find my opinion helpful.
For example I've been using both styles extensively on a project where there was no "should do this way" in this matter. I think I ended using "(\d+)" style more, because of, like you said:
having quotes makes it more clear where variables are in
As for constructing steps that are composed of other steps, I usually did:
Then /^I fill in my profile information with: "(.*)\/(.*)\/(.*)"$/ do |display_name, picture, description|
And %{I fill in "user_display_name" with "#{display}"}
And %{attach the file "#{picture}" to "user_picture"}
And %{I fill in "user_short_description" with "#{description}"}
end
Hope that helps, I am open for discussion :)