Country / City binds and AJAX and Norway
We came up with this problem that might affect anyone working
with geographically related forms.
Consider form with two select boxes: one has countries, one
has cities.
The city on is bound to a component that filters cities by
country code, so that if I select FRANCE in the country box, I get
a list of cities in France appearing in the cities box.
If you have set this up using standard country and naming
conventions, then your primary key for countries with be the ISO
2-letter country code (which is also the prefix for the currency
code).
So France is FR, The UK is GB, South Africa is ZA etc.
If you have done it this way, you will run in to a problem
with Norway (NO) as your coldfusion component will translate this
automatically into FALSE when your bind executes the city lookup.
Its a simple fix in the component - IF var = "FALSE" then set
var = "NO" but it can take a long time to figure out why you only
get this problem with Norway when everything else works
fine.
Lots of users have complained about LR's reverse geo-encoding. When LR suggests a sublocation/city/state/country from the GPS coordinates, it displays them in a grey font. (On my LR 5.7.1 Mac, it's dark grey, non-italic, very hard to read on my calibrated Eizo display; with LR 5.7.1 Windows on the same display, it's lighter grey, italic, a little easier to read.)
The annoying problem is that if you try to edit one of the fields, e.g. Sublocation, then all the other suggested fields will be erased after you move the selection to another photo. You have to first commit the suggested fields (turning the text to brighter white) by clicking twice on each of the labels. There is no way to batch-commit many photos at once.
Because of this and other infelicities in LR's geo support, many people, myself included, still rely on third-party tools such as Geosetter or the Geo-encoding Support plugin.
Please add your vote and opinion on this topic in the official Adobe feedback forum: Lightroom: improve control over reverse-geocoded Location metadata
Similar Messages
-
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP by David Powers
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and
PHP by David Powers:
Would this book help me learn about Spry and Ajax and how
applications can be made with them, if I my e-commerce site runs on
a compiled C code shopping cart (ShopSite) but supports PHP
server-side scripts or is it only for shopping carts based on PHP
itself (like X-Cart)?
I am not sure. Someone please let me know so I can purchase
this book. Thanks.ahsenabro wrote:
> 1. Do I have to be a developer/programmer in order to
learn from this book or
> can a tech-savvy entrepreneur can also get some gems out
of it and direct his
> programmer?
You don't need any prior knowledge of Ajax or PHP, but you do
need to
know the basics of HTML and CSS. As I say in the
introduction, "You
don't need to be an expert, but you do need to have an
inquiring mind.
It doesn't teach the basics of web design, nor does it
attempt to list
every single feature in Dreamweaver CS3. There are plenty of
other books
to fill that gap. However, by working through this book,
you'll gain an
in-depth knowledge of the most important features of
Dreamweaver."
> 2. I am interested in purchasing this book mainly to
implement cool Ajax/Spry
> stuff on my e-commerce site. I am asking about PHP
because the book's content
> mentions making a PHP site. Now I realize this book is
not about shopping
> carts, but the Ajax/Spry stuff can be implemented on
e-commerce sites, right?
The book provides detailed coverage of the Spry 1.4 features
in
Dreamweaver CS3, which can be applied to any site. With minor
adaptation, you can also use Spry 1.6. It's important to
realize,
though, that the Spry/Ajax features in Dreamweaver CS3 do
*not* cover
asynchronous requests to the server. The ability to
communicate
asynchronously with the server was added in Spry 1.6. If it's
asynchronous server calls and responses that you're after,
your
programmer will need to dig around in the Spry 1.6
documentation on the
Adobe Labs site, and hand-code it.
The Spry features covered in the book are Spry Effects, Spry
UI widgets
(menu, accordion, tabbed panels, and collapsible panels),
Spry
Validation Widgets, and Spry XML Data Sets.
> I just want to know if I can learn and implement
Ajax/Spry apps on my
> simple HTML/CSS-based pages, on a server which allows
server-side PHP scripts
> but the pages themselves are not with .php extension. Is
this book still going
> to be applicable?
Yes. All the Spry techniques can be used on any web page. It
doesn't
need to be a PHP one.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Hi,
I hope this is the correct forum for this.
We have two html select lists where I would like to display the values of second list based on what is selected in the first list (e.g., country and states). I was hoping to achieve this using AJAX and PL/SQL.
However, I noticed that though there are many examples of AJAX with HTMLDB (or application express), none use just PL/SQL and javascript. Can anyone refer me to an example that uses AJAX with PL/SQL (without needing APEX)?
ThanksYou don't really need AJAX to accomplish your task. Call this procedure via your browser to see how it works:
CREATE OR REPLACE PROCEDURE p (i_deptno INTEGER DEFAULT NULL)
AS
BEGIN
HTP.title ('AJAX/PLSQL');
HTP.p
('<select name=dept onChange="document.location.href=''p?i_deptno='' + this[selectedIndex].value">'
FOR c IN (SELECT *
FROM dept)
LOOP
HTP.p ('<option value=' || c.deptno
|| CASE
WHEN c.deptno = i_deptno
THEN ' selected '
END || '>'
HTP.p (c.dname);
END LOOP;
HTP.p ('</select>');
HTP.p ('<p/>');
IF i_deptno IS NOT NULL
THEN
HTP.p ('<select name=emp>');
FOR c IN (SELECT *
FROM emp
WHERE deptno = i_deptno)
LOOP
HTP.p ('<option value=' || c.empno || '>');
HTP.p (c.ename);
END LOOP;
HTP.p ('</select>');
END IF;
END p; -
Directory Binding Script (Active and Open Directory) 10.7
Hi everyone
I'm reposting this in the right thread. I've written a Directory Binding Script for 10.6 and ported it now to 10.7 as among the things that have changed in the upgraded version is a refurbished directory binding enviroment.
The original thread can be found here: https://discussions.apple.com/thread/3090068. The script is applicable for clients as well and simplifies the binding process considerably.
Be aware that the reformatted script here contains some faulty line breaks. So you'll have to correct them in a proper text editor.
#!/bin/sh
#Uncomment the following line to abort the script on errors
#trap exit ERR
## Script to automate OD and AD Binding of Mac OS X 10.7 Servers
## Script written by Marc Horat, URZ Basel, 11.6.2010
## Updated: 12.08.2011
# With the use of the following sources as inspiration:
# http://www.howtomac.co.uk/?p=247
#Created by Ross Hamilton
#Clock restart / Remove existing settings
#Join to Open Directory and Active Directory
# Bombich's AD-Bind Script:
# This script binds to AD and configures advanced options of the AD plugin
# As this scripts contains a password, be sure to take appropriate security
# precautions
# A good way to run this script is to set it as a login hook on your master machine
# Because it only needs to be run once, the last thing this script does is to delete
# itself. If you have another login script that you typically run, include the
# script on your master machine, and indicate its path in the "newLoginScript"
# variable.
# If running this as a one-time login hook to bind to AD after imaging,
# be sure to enable auto-login (for any local user) before creating your master image
#################CONFIGURATION##########################
#OD
# These variables need to be configured for your env
odAdmin="YOURODADMIN" #enter your OD admin name between the quotes
odPassword="YOURODPW" # Enter your OD admin password between the quotes
oddomain="YOURODDOMAIN" # FQDN of your OD domain
computerGroup="YOURNEWODCOMPGROUP" # Add appropriate computer group you want machines to be added to, case sensitive
oldComputerGroup="YOUROLDODCOMPGROUP" # If the Computer is in a Group already
#AD
# Standard parameters
domain="YOURADDOMAIN" # fully qualified DNS name of Active Directory Domain
domainname="YOURADDOMAINNAME" #Name of the Domain as specified in the search paths
udn="YOURADADMIN" # username of a privileged network user
password="YOURADPW" # password of a privileged network user
ou="OU=YOUR,OU=OU,OU=URZ,OU=IN,DC=YOUR,DC=AD,DC=DOMAIN" # Distinguished name of container for the computer E.G. OU=Macs,OU=Computers,DC=AD,DC=DOMAIN,DC=CH
# Advanced options AD Plugin
alldomains="disable" # 'enable' or 'disable' automatic multi-domain authentication
localhome="disable" # 'enable' or 'disable' force home directory to local drive
protocol="smb" # 'afp', 'smb' or 'nfs' (since 10.7) change how home is mounted from server
mobile="enable" # 'enable' or 'disable' mobile account support for offline logon
mobileconfirm="enable" # 'enable' or 'disable' warn the user that a mobile acct will be created
useuncpath="enable" # 'enable' or 'disable' use AD SMBHome attribute to determine the home dir
user_shell="/bin/bash" # e.g., /bin/bash or "none"
preferred="-preferred $domain" # Use the specified server for all Directory lookups and authentication
# (e.g. "-nopreferred" or "-preferred ad.server.edu")
admingroups="$domainname\YOURADADMINGROUP" # These comma-separated AD groups may administer the machine (e.g. "" or "APPLE\macadmins")
packetsign="allow" # allow | disable | require
packetencrypt="allow" # allow | disable | require
passinterval="14" # number of days
namespace="domain" # forest | domain
# Login hook setting -- specify the path to a login hook that you want to run instead of this script
newLoginHook="" # e.g., "/Library/Management/login.sh"
################################# End of configuration
############ Begin of Script
# Host-specific parameters
# computerid should be set dynamically, this value must be machine-specific
# This value may be restricted to 19 characters! The only error you'll receive upon entering
# an invalid computer id is to the effect of not having appropriate privileges to perform the requested operation
#computerid=`/sbin/ifconfig en0 | awk '/ether/ { gsub(":", ""); print $2 }'` # MAC Address
#computerid=`hostname | sed 's/.unibas.ch//'`
#computerid=`/usr/sbin/scutil --get LocalHostName | cut -c 1-19` # Assure that this will produce unique names!
#computerid=`/usr/sbin/scutil --get LocalHostName`
computerid=`scutil --get ComputerName`
adcomputerid=`echo "$computerid" | tr [:lower:] [:upper:]`
# These variables probably don't need to be changed
# Determing if any directory binding exists
nicAddress=`ifconfig en0 | grep ether | awk '{print $2}'`
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
check4ODtmp=`dscl localhost -list /LDAPv3 | grep -n 1 | sed 's/1://' | sed 's/2://'`
check4OD=${check4ODtmp//[[:space:]]/}
echo "Found LDAP: "$check4ODtmp
check4ODaccttmp=`dscl /LDAPv3/"$check4OD" -read Computers/"$computerid" RealName | cut -c 11-`
check4ODacct=${check4ODaccttmp//[[:space:]]/}
echo "Found LDAP-Computer-Account: "$check4ODacct
else
check4OD=""
check4ODacct=""
echo "No bound LDAP Server found"
fi
if [ $oldComputerGroup != "" ] && dscl localhost -list /LDAPv3 | grep . > /dev/null
then
check4ODgroupMembershiptmp=`dscl /LDAPv3/"$check4OD" -read ComputerGroups/"$oldComputerGroup" | grep "$computerid"`
check4ODgroupMembership=$check4ODgroupMembershiptmp
echo "LDAP Group Membership in Group: "$oldComputerGroup
else
check4ODgroupMembership=""
echo "No LDAP Group Membership defined or not bound to a server"
fi
if dscl localhost -list "/Active Directory" | grep $domainname > /dev/null
then
check4ADtmp=`dsconfigad -show | grep "Active Directory Domain" | sed 's/Active Directory Domain//' | sed 's/=//'`
check4AD=${check4ADtmp//[[:space:]]/}
echo "Found AD: "$check4AD
check4ADaccttmp=`dsconfigad -show | grep "Computer Account" | sed 's/Computer Account//' | sed 's/=//'`
check4ADacct=${check4ADaccttmp//[[:space:]]/}
echo "Found AD-Account: "$check4ADacct
else
check4AD=""
check4ADacct=""
echo "No AD-Account found"
fi
osversionlong=`sw_vers -productVersion`
osvers=${osversionlong:3:1}
#Time Sync
#Restart ntpdate
StartService ()
if [ "${TIMESYNC:=-YES-}" = "-YES-" ] && ! GetPID ntpd > /dev/null; then
CheckForNetwork
if [ -f /var/run/NetworkTime.StartupItem -o "${NETWORKUP}" = "-NO-" ]; then exit; fi
touch /var/run/NetworkTime.StartupItem
echo "Starting network time synchronization"
# Synchronize our clock to the network’s time,
# then fire off ntpd to keep the clock in sync.
ntpdate -bvs
ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid
fi
echo ""
echo ""
sleep 5
#### Removing any existing directory bindings
#Clear OD Computer Account and delete entry from Computer group
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
echo "This computer is bound to the following Open Directory Services:"
dscl localhost -list /LDAPv3
echo "With the Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /LDAP
sleep 5
if [ "${check4ODacct}" == "${computerid}" ]
then
echo "This machine already has a computer account on $oddomain."
# Set the GUID
GUID="$(dscl /LDAPv3/$oddomain -read /Computers/${computerid} GeneratedUID | awk '{ print $2 }')"
echo "Found GUID: "$GUID
if [ "$oldComputerGroup" != "" ] && [ "$check4ODgroupMembership" != "" ]
then
echo "Removing entry from group $oldComputerGroup"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerGroups/"$oldComputerGroup" GroupMembership "${computerid}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerGroups/"$oldComputerGroup" GroupMembers "${GUID}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerLists/"$oldComputerGroup" Computers "${computerid}"
fi
echo "Removing Computer entry $computerid in OD"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /Computers/"${computerid}"
fi
#List existing Directories
echo "Removing OD-Binding to "$check4OD
dsconfigldap -r "$check4OD"
echo "Removing Search Path entries"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4OD"
dscl /Search/Contacts -delete / CSPSearchPath /LDAPv3/"$check4OD"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4OD"
sleep 5
else
echo "No LDAP or OD Binding present.";
fi
echo ""
# Check a second time in order to delete any remaining LDAP-Bindings
echo "Scanning for further LDAP servers"
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
echo "Found:"
dscl localhost -list /LDAPv3
echo "Removing OD-Binding to "$check4ODtmp
dsconfigldap -r "$check4ODtmp"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
dscl /Search/Contacts -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
sleep 5
else
echo "No further LDAP or OD Binding present."
fi
echo ""
echo ""
#Remove the Active Directory binding
if [ "$check4AD" != "" ]
then
echo "This computer is bound to the following Active Directory Services:"
dscl localhost -list "/Active Directory"
echo "With the Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /Active
sleep 5
echo "Removing any existing AD-Binding to "$check4AD
dsconfigad -f -remove -username "$udn" -password "$password"
echo "Removing Search Path entries"
if [ "$preferred" != "-nopreferred" ]
then
dscl /Search -delete / CSPSearchPath /Active Directory/"$domainname"
dscl /Search/Contacts -delete / CSPSearchPath /Active Directory/"$domainname"
dscl /Search -delete / CSPSearchPath /Active Directory/"$domainname"
fi
dscl /Search -delete / CSPSearchPath "/Active Directory/$domainname/All Domains"
dscl /Search/Contacts -delete / CSPSearchPath "/Active Directory/$domainname/All Domains"
#remove search path entries from 10.6
if dscl /Search -read / CSPSearchPath | grep /Active > /dev/null
then
dscl /Search -delete / CSPSearchPath "/Active Directory/$domainname/$domain"
dscl /Search/Contacts -delete / CSPSearchPath "/Active Directory/$domainname/$domain"
fi
sleep 5
else
echo "No Active Directory Binding present."
fi
echo ""
#Remove Existing Directory Services Config
echo "Removing existing DS Config"
if [ -d "/Library/Preferences/edu.mit.Kerberos" ]
then
rm -R /Library/Preferences/edu.mit.Kerberos
fi
if [ -d "/etc/krb5.keytab" ]
then
rm -R /etc/krb5.keytab
fi
# Clean up the DirectoryService configuration files
rm -Rfv /Library/Preferences/DirectoryService/*
#OD
echo ""
echo ""
echo "Binding to OD-Damin "$oddomain
sleep 5
dsconfigldap -v -a "$oddomain" -n "$oddomain" -c "$computerid"
echo "Killing opendirectoryd"
killall opendirectoryd
sleep 5
echo "Adding computer account $computerid to /LDAPv3/${oddomain} on $oddomain"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -create /Computers/"$computerid" ENetAddress "$nicAddress"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /Computers/"$computerid" RealName "$computerid"
# Set the GUID
GUID="$(dscl /LDAPv3/$oddomain -read /Computers/${computerid} GeneratedUID | awk '{ print $2 }')"
# Add computer to ComputerList and ComputerGroup
if [ $computerGroup != "" ]
then
echo "Adding computer $computerid to OD group $computerGroup on $oddomain"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerLists/"$computerGroup" apple-computers "$computerid"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerGroups/"$computerGroup" apple-group-memberguid "${GUID}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerGroups/"$computerGroup" memberUid "$computerid"
fi
echo "Finished OD Binding."
sleep 5 # Give DS a chance to catch up
echo ""
echo ""
echo "Performing the AD Binding"
#AD
# Activate the AD plugin
defaults write /Library/Preferences/DirectoryService/DirectoryService "Active Directory" "Active"
plutil -convert xml1 /Library/Preferences/DirectoryService/DirectoryService.plist
#Use the existing AD-Computername or generate a new one
computeridtmp="default"
if [ "$check4ADacct" == "" ]
then
LEN=$(echo ${#adcomputerid})
if [ $LEN -lt 15 ]; then
echo "ComputerID "$adcomputerid " has 15 characters or less and is therefore suitable for AD-Binding. It is $adcomputerid"
computeridtmp=$adcomputerid
else
echo "ComputerID "$adcomputerid " has 16 or more characters and needs to be modified for AD-Binding."
echo "Removing any -"
computeridtmp=${adcomputerid//-/}
LEN=$(echo ${#computeridtmp})
if [ $LEN -lt 15 ]; then
echo "ComputerID "$computeridtmp" has now 15 characters or less and is therefore suitable for AD-Binding."
else
echo "Only using the last 15 characters of the Computer name to be able to bind to AD."
computeridtmp=${computeridtmp:(-15)}
fi
echo "Cropped Computername to "$computeridtmp
fi
else
computeridtmp=${check4ADacct//$/}
echo "Found existing AD Account previously, attempting to recreate in the OU: "$computeridtmp
fi
echo ""
# Bind to AD
echo "Binding to AD-Domain "$domain" with computerid "$computeridtmp
dsconfigad -f -add "$domain" -username "$udn" -password "$password" -ou "$ou" -computer "$computeridtmp"
echo ""
echo "Setting the Advanced AD Plugin options"
# Configure advanced AD plugin options
if [ "$admingroups" = "" ]
then
dsconfigad -nogroups
else
dsconfigad -groups "$admingroups"
fi
dsconfigad -alldomains "$alldomains"
dsconfigad -localhome "$localhome"
dsconfigad -protocol "$protocol"
dsconfigad -mobile "$mobile"
dsconfigad -mobileconfirm "$mobileconfirm"
dsconfigad -useuncpath "$useuncpath"
dsconfigad -shell "$user_shell"
dsconfigad "$preferred"
dsconfigad -packetsign "$packetsign" -packetencrypt "$packetencrypt" -passinterval "$passinterval"
dsconfigad -namespace "$namespace"
sleep 5
echo ""
echo ""
# Add the OD & AD node to the search path
if [ "$alldomains" = "enable" ]
then
csp="/Active Directory/$domainname/All Domains"
else
csp="/Active Directory/$domainname"
fi
echo "Finished AD Binding."
echo "Adding Domain /LDAPv3/"$oddomain" and "$csp" to Search Path"
dscl /Search -create / SearchPolicy CSPSearchPath
dscl /Search/Contacts -create / SearchPolicy CSPSearchPath
echo "Adding OD.."
dscl /Search -append / CSPSearchPath /LDAPv3/"$oddomain"
dscl /Search/Contacts -append / CSPSearchPath /LDAPv3/"$oddomain"
echo "Adding AD.."
#Adding all Domains first to improve reliability under 10.7
if [ "$alldomains" != "enable" ]
then
cspadall="/Active Directory/$domainname/All Domains"
dscl /Search/Contacts -append / CSPSearchPath "$cspadall"
dscl /Search -append / CSPSearchPath "$cspadall"
fi
dscl /Search/Contacts -append / CSPSearchPath "$csp"
dscl /Search -append / CSPSearchPath "$csp"
echo "Finished Updating Search Paths."
echo ""
echo ""
# Restart DirectoryService (necessary to reload AD plugin activation settings)
killall opendirectoryd
# Destroy the login hook (or change it)
if [ "${newLoginHook}" == "" ]
then
defaults delete /var/root/Library/Preferences/com.apple.loginwindow LoginHook
else
defaults write /var/root/Library/Preferences/com.apple.loginwindow LoginHook $newLoginHook
fi
sleep 5
# Customizing the login-Window
#defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo DSStatus
#defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool TRUE
#defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool TRUE
# This works in a pinch if the above code does not
#defaults write /Library/Preferences/DirectoryService/SearchNodeConfig "Search Node Custom Path Array" -array "/Active Directory/All Domains"
#defaults write /Library/Preferences/DirectoryService/SearchNodeConfig "Search Policy" -int 3
#plutil -convert xml1 /Library/Preferences/DirectoryService/SearchNodeConfig.plist
#killall opendirectoryd
# Disable autologin
defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser
srm /etc/kcpassword
echo ""
echo ""
echo ""
echo "Now bound to OD Domain:"
dscl localhost -list /LDAPv3
echo "With Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /LDAP
echo "Now bound to AD Domain:"
dscl localhost -list "/Active Directory"
echo "With Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /Active
exit 0 ## Success
exit 1 ## Failure
Any inputs, questions and improvement suggestions are, of course, most welcome!
Cheers
SeeHi everyone
I'm reposting this in the right thread. I've written a Directory Binding Script for 10.6 and ported it now to 10.7 as among the things that have changed in the upgraded version is a refurbished directory binding enviroment.
The original thread can be found here: https://discussions.apple.com/thread/3090068. The script is applicable for clients as well and simplifies the binding process considerably.
Be aware that the reformatted script here contains some faulty line breaks. So you'll have to correct them in a proper text editor.
#!/bin/sh
#Uncomment the following line to abort the script on errors
#trap exit ERR
## Script to automate OD and AD Binding of Mac OS X 10.7 Servers
## Script written by Marc Horat, URZ Basel, 11.6.2010
## Updated: 12.08.2011
# With the use of the following sources as inspiration:
# http://www.howtomac.co.uk/?p=247
#Created by Ross Hamilton
#Clock restart / Remove existing settings
#Join to Open Directory and Active Directory
# Bombich's AD-Bind Script:
# This script binds to AD and configures advanced options of the AD plugin
# As this scripts contains a password, be sure to take appropriate security
# precautions
# A good way to run this script is to set it as a login hook on your master machine
# Because it only needs to be run once, the last thing this script does is to delete
# itself. If you have another login script that you typically run, include the
# script on your master machine, and indicate its path in the "newLoginScript"
# variable.
# If running this as a one-time login hook to bind to AD after imaging,
# be sure to enable auto-login (for any local user) before creating your master image
#################CONFIGURATION##########################
#OD
# These variables need to be configured for your env
odAdmin="YOURODADMIN" #enter your OD admin name between the quotes
odPassword="YOURODPW" # Enter your OD admin password between the quotes
oddomain="YOURODDOMAIN" # FQDN of your OD domain
computerGroup="YOURNEWODCOMPGROUP" # Add appropriate computer group you want machines to be added to, case sensitive
oldComputerGroup="YOUROLDODCOMPGROUP" # If the Computer is in a Group already
#AD
# Standard parameters
domain="YOURADDOMAIN" # fully qualified DNS name of Active Directory Domain
domainname="YOURADDOMAINNAME" #Name of the Domain as specified in the search paths
udn="YOURADADMIN" # username of a privileged network user
password="YOURADPW" # password of a privileged network user
ou="OU=YOUR,OU=OU,OU=URZ,OU=IN,DC=YOUR,DC=AD,DC=DOMAIN" # Distinguished name of container for the computer E.G. OU=Macs,OU=Computers,DC=AD,DC=DOMAIN,DC=CH
# Advanced options AD Plugin
alldomains="disable" # 'enable' or 'disable' automatic multi-domain authentication
localhome="disable" # 'enable' or 'disable' force home directory to local drive
protocol="smb" # 'afp', 'smb' or 'nfs' (since 10.7) change how home is mounted from server
mobile="enable" # 'enable' or 'disable' mobile account support for offline logon
mobileconfirm="enable" # 'enable' or 'disable' warn the user that a mobile acct will be created
useuncpath="enable" # 'enable' or 'disable' use AD SMBHome attribute to determine the home dir
user_shell="/bin/bash" # e.g., /bin/bash or "none"
preferred="-preferred $domain" # Use the specified server for all Directory lookups and authentication
# (e.g. "-nopreferred" or "-preferred ad.server.edu")
admingroups="$domainname\YOURADADMINGROUP" # These comma-separated AD groups may administer the machine (e.g. "" or "APPLE\macadmins")
packetsign="allow" # allow | disable | require
packetencrypt="allow" # allow | disable | require
passinterval="14" # number of days
namespace="domain" # forest | domain
# Login hook setting -- specify the path to a login hook that you want to run instead of this script
newLoginHook="" # e.g., "/Library/Management/login.sh"
################################# End of configuration
############ Begin of Script
# Host-specific parameters
# computerid should be set dynamically, this value must be machine-specific
# This value may be restricted to 19 characters! The only error you'll receive upon entering
# an invalid computer id is to the effect of not having appropriate privileges to perform the requested operation
#computerid=`/sbin/ifconfig en0 | awk '/ether/ { gsub(":", ""); print $2 }'` # MAC Address
#computerid=`hostname | sed 's/.unibas.ch//'`
#computerid=`/usr/sbin/scutil --get LocalHostName | cut -c 1-19` # Assure that this will produce unique names!
#computerid=`/usr/sbin/scutil --get LocalHostName`
computerid=`scutil --get ComputerName`
adcomputerid=`echo "$computerid" | tr [:lower:] [:upper:]`
# These variables probably don't need to be changed
# Determing if any directory binding exists
nicAddress=`ifconfig en0 | grep ether | awk '{print $2}'`
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
check4ODtmp=`dscl localhost -list /LDAPv3 | grep -n 1 | sed 's/1://' | sed 's/2://'`
check4OD=${check4ODtmp//[[:space:]]/}
echo "Found LDAP: "$check4ODtmp
check4ODaccttmp=`dscl /LDAPv3/"$check4OD" -read Computers/"$computerid" RealName | cut -c 11-`
check4ODacct=${check4ODaccttmp//[[:space:]]/}
echo "Found LDAP-Computer-Account: "$check4ODacct
else
check4OD=""
check4ODacct=""
echo "No bound LDAP Server found"
fi
if [ $oldComputerGroup != "" ] && dscl localhost -list /LDAPv3 | grep . > /dev/null
then
check4ODgroupMembershiptmp=`dscl /LDAPv3/"$check4OD" -read ComputerGroups/"$oldComputerGroup" | grep "$computerid"`
check4ODgroupMembership=$check4ODgroupMembershiptmp
echo "LDAP Group Membership in Group: "$oldComputerGroup
else
check4ODgroupMembership=""
echo "No LDAP Group Membership defined or not bound to a server"
fi
if dscl localhost -list "/Active Directory" | grep $domainname > /dev/null
then
check4ADtmp=`dsconfigad -show | grep "Active Directory Domain" | sed 's/Active Directory Domain//' | sed 's/=//'`
check4AD=${check4ADtmp//[[:space:]]/}
echo "Found AD: "$check4AD
check4ADaccttmp=`dsconfigad -show | grep "Computer Account" | sed 's/Computer Account//' | sed 's/=//'`
check4ADacct=${check4ADaccttmp//[[:space:]]/}
echo "Found AD-Account: "$check4ADacct
else
check4AD=""
check4ADacct=""
echo "No AD-Account found"
fi
osversionlong=`sw_vers -productVersion`
osvers=${osversionlong:3:1}
#Time Sync
#Restart ntpdate
StartService ()
if [ "${TIMESYNC:=-YES-}" = "-YES-" ] && ! GetPID ntpd > /dev/null; then
CheckForNetwork
if [ -f /var/run/NetworkTime.StartupItem -o "${NETWORKUP}" = "-NO-" ]; then exit; fi
touch /var/run/NetworkTime.StartupItem
echo "Starting network time synchronization"
# Synchronize our clock to the network’s time,
# then fire off ntpd to keep the clock in sync.
ntpdate -bvs
ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid
fi
echo ""
echo ""
sleep 5
#### Removing any existing directory bindings
#Clear OD Computer Account and delete entry from Computer group
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
echo "This computer is bound to the following Open Directory Services:"
dscl localhost -list /LDAPv3
echo "With the Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /LDAP
sleep 5
if [ "${check4ODacct}" == "${computerid}" ]
then
echo "This machine already has a computer account on $oddomain."
# Set the GUID
GUID="$(dscl /LDAPv3/$oddomain -read /Computers/${computerid} GeneratedUID | awk '{ print $2 }')"
echo "Found GUID: "$GUID
if [ "$oldComputerGroup" != "" ] && [ "$check4ODgroupMembership" != "" ]
then
echo "Removing entry from group $oldComputerGroup"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerGroups/"$oldComputerGroup" GroupMembership "${computerid}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerGroups/"$oldComputerGroup" GroupMembers "${GUID}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /ComputerLists/"$oldComputerGroup" Computers "${computerid}"
fi
echo "Removing Computer entry $computerid in OD"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$check4OD" -delete /Computers/"${computerid}"
fi
#List existing Directories
echo "Removing OD-Binding to "$check4OD
dsconfigldap -r "$check4OD"
echo "Removing Search Path entries"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4OD"
dscl /Search/Contacts -delete / CSPSearchPath /LDAPv3/"$check4OD"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4OD"
sleep 5
else
echo "No LDAP or OD Binding present.";
fi
echo ""
# Check a second time in order to delete any remaining LDAP-Bindings
echo "Scanning for further LDAP servers"
if dscl localhost -list /LDAPv3 | grep . > /dev/null
then
echo "Found:"
dscl localhost -list /LDAPv3
echo "Removing OD-Binding to "$check4ODtmp
dsconfigldap -r "$check4ODtmp"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
dscl /Search/Contacts -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
dscl /Search -delete / CSPSearchPath /LDAPv3/"$check4ODtmp"
sleep 5
else
echo "No further LDAP or OD Binding present."
fi
echo ""
echo ""
#Remove the Active Directory binding
if [ "$check4AD" != "" ]
then
echo "This computer is bound to the following Active Directory Services:"
dscl localhost -list "/Active Directory"
echo "With the Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /Active
sleep 5
echo "Removing any existing AD-Binding to "$check4AD
dsconfigad -f -remove -username "$udn" -password "$password"
echo "Removing Search Path entries"
if [ "$preferred" != "-nopreferred" ]
then
dscl /Search -delete / CSPSearchPath /Active Directory/"$domainname"
dscl /Search/Contacts -delete / CSPSearchPath /Active Directory/"$domainname"
dscl /Search -delete / CSPSearchPath /Active Directory/"$domainname"
fi
dscl /Search -delete / CSPSearchPath "/Active Directory/$domainname/All Domains"
dscl /Search/Contacts -delete / CSPSearchPath "/Active Directory/$domainname/All Domains"
#remove search path entries from 10.6
if dscl /Search -read / CSPSearchPath | grep /Active > /dev/null
then
dscl /Search -delete / CSPSearchPath "/Active Directory/$domainname/$domain"
dscl /Search/Contacts -delete / CSPSearchPath "/Active Directory/$domainname/$domain"
fi
sleep 5
else
echo "No Active Directory Binding present."
fi
echo ""
#Remove Existing Directory Services Config
echo "Removing existing DS Config"
if [ -d "/Library/Preferences/edu.mit.Kerberos" ]
then
rm -R /Library/Preferences/edu.mit.Kerberos
fi
if [ -d "/etc/krb5.keytab" ]
then
rm -R /etc/krb5.keytab
fi
# Clean up the DirectoryService configuration files
rm -Rfv /Library/Preferences/DirectoryService/*
#OD
echo ""
echo ""
echo "Binding to OD-Damin "$oddomain
sleep 5
dsconfigldap -v -a "$oddomain" -n "$oddomain" -c "$computerid"
echo "Killing opendirectoryd"
killall opendirectoryd
sleep 5
echo "Adding computer account $computerid to /LDAPv3/${oddomain} on $oddomain"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -create /Computers/"$computerid" ENetAddress "$nicAddress"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /Computers/"$computerid" RealName "$computerid"
# Set the GUID
GUID="$(dscl /LDAPv3/$oddomain -read /Computers/${computerid} GeneratedUID | awk '{ print $2 }')"
# Add computer to ComputerList and ComputerGroup
if [ $computerGroup != "" ]
then
echo "Adding computer $computerid to OD group $computerGroup on $oddomain"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerLists/"$computerGroup" apple-computers "$computerid"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerGroups/"$computerGroup" apple-group-memberguid "${GUID}"
dscl -u "${odAdmin}" -P "${odPassword}" /LDAPv3/"$oddomain" -merge /ComputerGroups/"$computerGroup" memberUid "$computerid"
fi
echo "Finished OD Binding."
sleep 5 # Give DS a chance to catch up
echo ""
echo ""
echo "Performing the AD Binding"
#AD
# Activate the AD plugin
defaults write /Library/Preferences/DirectoryService/DirectoryService "Active Directory" "Active"
plutil -convert xml1 /Library/Preferences/DirectoryService/DirectoryService.plist
#Use the existing AD-Computername or generate a new one
computeridtmp="default"
if [ "$check4ADacct" == "" ]
then
LEN=$(echo ${#adcomputerid})
if [ $LEN -lt 15 ]; then
echo "ComputerID "$adcomputerid " has 15 characters or less and is therefore suitable for AD-Binding. It is $adcomputerid"
computeridtmp=$adcomputerid
else
echo "ComputerID "$adcomputerid " has 16 or more characters and needs to be modified for AD-Binding."
echo "Removing any -"
computeridtmp=${adcomputerid//-/}
LEN=$(echo ${#computeridtmp})
if [ $LEN -lt 15 ]; then
echo "ComputerID "$computeridtmp" has now 15 characters or less and is therefore suitable for AD-Binding."
else
echo "Only using the last 15 characters of the Computer name to be able to bind to AD."
computeridtmp=${computeridtmp:(-15)}
fi
echo "Cropped Computername to "$computeridtmp
fi
else
computeridtmp=${check4ADacct//$/}
echo "Found existing AD Account previously, attempting to recreate in the OU: "$computeridtmp
fi
echo ""
# Bind to AD
echo "Binding to AD-Domain "$domain" with computerid "$computeridtmp
dsconfigad -f -add "$domain" -username "$udn" -password "$password" -ou "$ou" -computer "$computeridtmp"
echo ""
echo "Setting the Advanced AD Plugin options"
# Configure advanced AD plugin options
if [ "$admingroups" = "" ]
then
dsconfigad -nogroups
else
dsconfigad -groups "$admingroups"
fi
dsconfigad -alldomains "$alldomains"
dsconfigad -localhome "$localhome"
dsconfigad -protocol "$protocol"
dsconfigad -mobile "$mobile"
dsconfigad -mobileconfirm "$mobileconfirm"
dsconfigad -useuncpath "$useuncpath"
dsconfigad -shell "$user_shell"
dsconfigad "$preferred"
dsconfigad -packetsign "$packetsign" -packetencrypt "$packetencrypt" -passinterval "$passinterval"
dsconfigad -namespace "$namespace"
sleep 5
echo ""
echo ""
# Add the OD & AD node to the search path
if [ "$alldomains" = "enable" ]
then
csp="/Active Directory/$domainname/All Domains"
else
csp="/Active Directory/$domainname"
fi
echo "Finished AD Binding."
echo "Adding Domain /LDAPv3/"$oddomain" and "$csp" to Search Path"
dscl /Search -create / SearchPolicy CSPSearchPath
dscl /Search/Contacts -create / SearchPolicy CSPSearchPath
echo "Adding OD.."
dscl /Search -append / CSPSearchPath /LDAPv3/"$oddomain"
dscl /Search/Contacts -append / CSPSearchPath /LDAPv3/"$oddomain"
echo "Adding AD.."
#Adding all Domains first to improve reliability under 10.7
if [ "$alldomains" != "enable" ]
then
cspadall="/Active Directory/$domainname/All Domains"
dscl /Search/Contacts -append / CSPSearchPath "$cspadall"
dscl /Search -append / CSPSearchPath "$cspadall"
fi
dscl /Search/Contacts -append / CSPSearchPath "$csp"
dscl /Search -append / CSPSearchPath "$csp"
echo "Finished Updating Search Paths."
echo ""
echo ""
# Restart DirectoryService (necessary to reload AD plugin activation settings)
killall opendirectoryd
# Destroy the login hook (or change it)
if [ "${newLoginHook}" == "" ]
then
defaults delete /var/root/Library/Preferences/com.apple.loginwindow LoginHook
else
defaults write /var/root/Library/Preferences/com.apple.loginwindow LoginHook $newLoginHook
fi
sleep 5
# Customizing the login-Window
#defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo DSStatus
#defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool TRUE
#defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool TRUE
# This works in a pinch if the above code does not
#defaults write /Library/Preferences/DirectoryService/SearchNodeConfig "Search Node Custom Path Array" -array "/Active Directory/All Domains"
#defaults write /Library/Preferences/DirectoryService/SearchNodeConfig "Search Policy" -int 3
#plutil -convert xml1 /Library/Preferences/DirectoryService/SearchNodeConfig.plist
#killall opendirectoryd
# Disable autologin
defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser
srm /etc/kcpassword
echo ""
echo ""
echo ""
echo "Now bound to OD Domain:"
dscl localhost -list /LDAPv3
echo "With Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /LDAP
echo "Now bound to AD Domain:"
dscl localhost -list "/Active Directory"
echo "With Search Path entries:"
dscl /Search -read / CSPSearchPath | grep /Active
exit 0 ## Success
exit 1 ## Failure
Any inputs, questions and improvement suggestions are, of course, most welcome!
Cheers
See -
How to handle jquery and ajax call in single page application using coded ui
Hi,
I am facing a very tricky situation while using coded ui. My application interact with ajax and I was facing the issue to handle the ajax in the login page and other pages. I went through the post : http://stackoverflow.com/questions/17849074/jquery-ajax-success-not-getting-triggered-with-coded-ui-test-project
and got solution for my problem. Now when ever a ajax is getting called in the page its getting handle with app config file. However the issue I am facing right now is.
When i click on a button a window will appear which is actually a "div tag". Please see the image below. In the that window when I have to select a item from drop down, the ajax will get called, however it will get called only for the window,
it wont be called for the entire page.. i.e. it will update only the window. I am not able to handle this ajax call, script gets stuck in refresh state. I will request you guys to provide a work around for it.
I would like to add more details - Visual studio version - 2013 update 3, IE11.
Application details: Its a single page application which uses bootstrap framework. All the ajax call are dynamic.
Thanks in advance.Thanks for the reply.
The window is not exactly a pop up window. Its a div tag in the same page. As this is my first time to work on a single page application I am not sure how it works. For the entire page I am able to handle the ajax call however the action performed
in the div tag is not getting handled.
Code for the window, I am not sure to what extend will it be helpful.
<div class="modal-content"><div class="modal-header"><div class="bootstrap-dialog-header"><div class="bootstrap-dialog-close-button" style="display: none;"><button class="close">×</button></div><div
class="bootstrap-dialog-title">Move Item to different task [FocusAudit]</div></div></div><div class="modal-body"><div class="bootstrap-dialog-body"><div class="bootstrap-dialog-message"><div><div
id="dashboard">
<table class="TFtable">
<tbody><tr>
<td colspan="2">
You are about to move the 24 selected item item to a different task. Select the task to which to move this item, (Optionally) enter notes about the task change, and click 'Change' to continue.
</td>
</tr>
<tr>
<td>Select New WorkFlow:</td>
<td><select class="form-control" id="MA_workflow" onchange="ChangeWorkFlow()"><option value="647446014">Batches<option value="647446007">Claim<option value="647446065"
selected="">Workflow1</option></select></td>
</tr>
<tr>
<td>Select New Task:</td>
<td><select class="form-control" id="MA_actions"><option value="647446025">BatchRebuild</option><option value="647446054">Complete</option><option value="647446039">DataIntegrityCheck</option><option
value="647446038">FocusAudit</option><option value="647446053">FocusAuditMiner</option><option value="647446037">FocusAuditSelect</option><option value="647446055">LocationRouter</option><option
value="647446029">MineForSBT</option><option value="647446022">OCRtoWebDE</option><option value="647446024">OnePass</option><option value="647446049">OnePassRouter</option><option
value="647446050">OnePassUS</option><option value="647446060">QAuditImporter</option><option value="647446045">QIAutoAuditGrader</option><option value="647446058">QIAutoAuditInjector</option><option
value="647446048">QIMiner</option><option value="647446040">QISampler</option><option value="647446056">QIVerify</option><option value="647446059">QIVerifyGrader</option><option
value="647446047">QIVerifyUS</option><option value="647446021">RecoRules</option><option value="647446082">Review</option><option value="647446042">Router</option><option
value="647446023">Validate</option><option value="647446081">Verify</option><option value="647446080">WebDEFileCreator</option></select></td>
</tr>
<tr>
<td>Select New Status:</td>
<td>
<select class="form-control" id="MA_status">
<option value="ready">Ready</option>
<option value="reject">Rejected</option>
<option value="hold">Held</option>
<option value="ready">Keep Status From Original Task</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">Notes:</td>
</tr>
<tr>
<td colspan="2">
<textarea name="MA_statusnote" class="form-control" id="MA_statusnote" maxlength="250" rows="5" cols="40"></textarea>
</td>
</tr>
<tr>
<td style="text-align: right;" colspan="2">
<input class="btn btn-default list-inline" id="btnSubmit" onclick="prepareData_MoveToAction();" type="button" value="Change">
<input class="btn btn-cancel" id="btnCancel" style="padding-left: 5px;" onclick=" dialogInstance2.close();" type="button" value="Cancel">
</td>
</tr>
</tbody></table>
<div id="overlayDialog" style="display: none;">
<div style="width: 100%; text-align: center;">
<h1>Processing...</h1>
<img src="Images/ajax-loader.gif">
</div>
</div>
<div id="dData_MoveToAction" style="display: none;" data-itemcount="24" data-oldactionidno="647446079" data-oldstatus="ready" data-oldactionname="FocusAudit" data-fnparent="PS"></div>
</div>
<script id="scrpd" language="text/javascript">
<!--
var cworkflow =$('#MA_workflow option:selected').text();
function initMoveToAction()
function ChangeWorkFlow(){
$('#overlayDialog').show(300);
var _newworkflowname=$('#MA_workflow option:selected').text();
if(cworkflow!=_newworkflowname)
getItemType();
cworkflow = _newworkflowname;
function getItemType()
var _workflowid=$('#MA_workflow option:selected').text();
var formData = { workflowid: _workflowid}
var sPage = './Handlers/GenericFn.ashx?action=getitemtype';
$.ajax({
url: sPage,
type: "POST",
data: formData,
datatype: JSON,
success: function (data, textStatus, jqXHR) {
var newItemActions = jQuery.parseJSON(data);
$('#MA_actions').empty();
$.each(newItemActions, function(i, option) {
$('#MA_actions').append($('<option></option>').attr("value", option.Value).text(option.Key));
$('#overlayDialog').hide(300);
error: function (data) {
var error = jQuery.parseJSON(data.responseText)
SetProdSummary();
dialogInstance2.close();
ErrorMessage(error.ErrorCaption, error.ErrorDescription, error.IsCloseWindow);
function prepareData_MoveToAction()
var ma_oldstatus, ma_oldactionname, ma_actionidno,ma_oldactionid, ma_statusNote,ma_itemNewStatus,ma_itemtotalno, ma_newworkflowname,ma_fnparen;
ma_itemNewStatus = $('#MA_status option:selected' ).val();
ma_actionidno=$('#MA_actions option:selected').val();
ma_newworkflowname=$('#MA_workflow option:selected').text();
ma_statusNote = $("#MA_statusnote").val();
var params = $("#dData_MoveToAction");
if (params.data("oldstatus"))
ma_oldstatus = params.data("oldstatus");
if (params.data("oldactionname"))
ma_oldactionname = params.data("oldactionname");
if (params.data("oldactionidno"))
ma_oldactionid = params.data("oldactionidno");
if (params.data("itemcount"))
ma_itemtotalno = params.data("itemcount");
if (params.data("fnparent"))
ma_fnparen = params.data("fnparent");
var formData = { currentstatus: ma_oldstatus, oldactionid:ma_oldactionid,newstatus: ma_itemNewStatus, actionid: ma_actionidno, oldactionName:ma_oldactionname, statusnote: ma_statusNote,totalno:ma_itemtotalno, newworkflowname:
ma_newworkflowname,fnparent:ma_fnparen};
var sPage = './Handlers/ItemAction_MoveToAction.ashx?action=movetoaction';
$('#overlayDialog').show(300);
$('#btnSubmit').attr('disabled',true);
$('#btnCancel').attr('disabled',true);
$.ajax({
url: sPage,
type: "POST",
data: formData,
datatype: JSON,
success: function (data, textStatus, jqXHR) {
SetProdSummary();
$('#overlayDialog').hide(300);
dialogInstance2.close();
error: function (data) {
var error = jQuery.parseJSON(data.responseText)
SetProdSummary();
dialogInstance2.close();
ErrorMessage(error.ErrorCaption, error.ErrorDescription, error.IsCloseWindow);
-->
</script></div></div></div></div><div class="modal-footer" style="display: none;"><div class="bootstrap-dialog-footer"></div></div></div>
I agree the point the UI has to be active or else the script will have issue during the playback. In my scenario I have to work on that window. I have to perform action on it. Now when the window(div thing) comes up the page in the background goes disable
till the action is performed on the window or the window is closed. I have to perform action on it then only I can proceed with the TC automation. Please let me know any option to solve this problem.
Thanks
Ahetejazahmad Khan. -
Uploading a file to server using ajax and struts
My problem is i wrote a program to upload a file to the server using Ajax.
Here iam used Struts and Ajax.
The problem is when iam uploaded a file from my PC the file is uploading to the server in the upload folder located in the server my system.
Iam using Tomcat server 5.0
But when iam trying to access it through other system it is not doing so
Giving an internal server error i,e 500.
Iam putting the necessary documents for ur reference.
Plz help me soon .
My exact requirement is i have to upload a file to the upload folder located in the server.
And i have to get the path of that file and display the file path exactly below the browse button from where iam uploaded a file.
That should be done without page refresh and submit thats y iam used Ajax
Any help would greatly appreciated
Thanks and Regards
Meerasaaheb.
The action class is FilePathAction
package actions;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
public class FilePathAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
String contextPath1 = "";
String uploadDirName="";
String filepath="";
System.out.println(contextPath1 );
String inputfile = request.getParameter("filepath");
uploadDirName = getServlet().getServletContext().getRealPath("/upload");
File f=new File(inputfile);
FileInputStream fis=null;
FileOutputStream fo=null;
File f1=new File(uploadDirName+"/"+f.getName());
fis=new FileInputStream(f);
fo=new FileOutputStream(f1);
try
byte buf[] = new byte[1024*8]; /* declare a 8kB buffer */
int len = -1;
while((len = fis.read(buf)) != -1)
fo.write(buf, 0, len);
catch(Exception e)
e.printStackTrace();
filepath=f1.getAbsolutePath();
request.setAttribute("filepath", filepath);
return mapping.findForward("filepath");
the input jsp is
filename.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
alertflag = false;
var xmlHttp;
function startRequest()
if(alertflag)
alert("meera");
xmlHttp=createXmlHttpRequest();
var inputfile=document.getElementById("filepath").value;
xmlHttp.open("POST","FilePathAction.do",true);
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send("filepath="+inputfile);
function createXmlHttpRequest()
//For IE
if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
//otherthan IE
else if(window.XMLHttpRequest)
xmlHttp=new XMLHttpRequest();
return xmlHttp;
//Next is the function that sets up the communication with the server.
//This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
function handleStateChange()
var message=" ";
if(xmlHttp.readyState==4)
if(alertflag)
alert(xmlHttp.status);
if(xmlHttp.status==200)
if(alertflag)
alert("here");
document.getElementById("div1").style.visibility = "visible";
var results=xmlHttp.responseText;
document.getElementById('div1').innerHTML = results;
else
alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
</script></head><body><form name="thumbs" enctype="multipart/form-data" method="post" action="">
<input type="file" name="filepath" id="filepath" onchange="startRequest();"/>
</form>
<div id="div1" style="visibility:hidden;">
</div></body></html>
The ajax response is catching in a dummy.jsp
<%=(String)request.getAttribute("filepath")%>
corresponding action mapping
<action path="/FilePathAction" type="actions.FilePathAction">
<forward name="filepath" path="/dummy.jsp"/>
</action>
So plz help me to upload a file to the server from any PC.
Iam searched alot but didnt get any solution.Plz help me soon if it possible so
Iam in great need.
I have worked alot but not worked out.
Any help greatly appreciated -
Use ajax and validation at the same time
Hi everyone,
I've been trying Spry for a little while. It's quite cool to
me! The validation widget is good and ajax, but I'm not sure how to
use both of them in a form.
I have a contact form which needs the name, email and message
required validation. I don't use the onblur or onchange validation
but onsubmit (by default). I want that when user clicks the submit
button, it will call ajax to send the email to me without
refreshing the page. So in the onsubmit event I put this
onSubmit="return Spry.Utils.submitForm(this, updateResponseDiv);"
like in the sample. But in fact it calls ajax directly and skips
the validation.
Are there any ways to make it not to execute the ajax call
when validation is not passed?
Thanks a lot!check out this:
http://labs.adobe.com/technologies/spry/samples/form_submission/Submit_and_Validate_Form.p hp.html -
I bought a $15 app GTA Vice City a while ago and I just started using it and it doesn't work. I checked all the requirements and my laptop meets all of them. I also have contacted Rockstar Games and they didn't help. Can I get my money back? Its frustruating.
Hi...
Apple's policy states that, "all sales are final" > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
But since you are not getting any help from the developer, you can use the email form to contact Apple and ask for a refund > Apple - Support - Mac App Store - Contact Support.
No guarantees. -
I am trying to change the country on my iTunes account, and I have a msg please contact Itune support, any help?
These are user-to-user forums, you can contact iTunes support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
-
I have moved from the UK to the USA and have a new phone, I try to change my country location on the store and get an error message saying I have to cancel my itunes match and also that I have a pass incomplete, any ideas how to fix and change the store. It is becoming a problem with getting some USA aps and content
Thank you
TomiTunes match is a subscription that you have in when you were still in the UK. According to the terms & conditions you'll need to wait for the susbcription to end before you can change your country to iTunes Store USA.
-
Trying to purchase trial period in different email address - error message "Error in Your Order The account was registered for a different country. Please sign out and sign in using an existing account for this country. Ok"@
Hi boags2014,
Please refer this link and know the work-arounds for the same:
How do I complete a purchase when I get an incorrect "country" error?
Regards,
Anubha -
Binding between Task and method dissappears
The binding between task and method is dissappearing .
I tried creating a new task altogether but still not working
kindly help
Edited by: kittu reddy on May 6, 2008 3:19 PMI have Zmethod and i have done binding between the task and the method and
Task and workflow..
Binding between Task and work flow doesnt seem to Disappear
but the binding between Task and the method kept on disappearing
I have a Zmethod to Bus2091(delagated to Zbus2091)
with an import parameter and an export parameter
and now when creating the task and assigning the method the container elements of method are transferred to Task
and next i wen to binding eeditor and generated automatic binding:
From task to method
and method to task
with out errors and now on clicked green tick mark of the binding editor and saved the Task and now on checking back the binding editor
i find the binding disppearead -
Macbook Pro 15 Change Country Code to get 11n and 300 Mbit/s
Hello All!
I have a question: how can I change Country Code on my MBP 15" to get wi-fi 11n mode and 300 Mbit/s (or at least 130) with my TL-WR1043ND router. I've changed the Region setting in the web interface of my router, but it didn't solve the problem. And there is a wonder but my macbook 13" has Country Code: X2 (sometimes FR) and use 11n mode with transmit rate: 130 Mbit/s. So, as for me, that is very strange dependence — Country Code and Connection Speed.
System info:
Router preferences:
Thanx!So, I have MBP 15-inch, Mid 2010 and MB 13-inch, Mid 2009. And, as I said before, MB 13 doesn't have the problem with 11g mode, it has Contry Code X2 or sometimes FR, but never UA. And the MB13 is older then the MBP15. Maybe problem is in the router, but I don't know how figure out it. And I don't understand, at all, the dependence Transfer Rate and Country Code — why software is restrict connection speed of hardware?
-
Hey,
when I try to buy products I'm getting the following error when going to checkout:
Error in Your Order
The account was registered for a different country. Please sign out and sign in using an existing account for this country.
how do fix it?Hi boags2014,
Please refer this link and know the work-arounds for the same:
How do I complete a purchase when I get an incorrect "country" error?
Regards,
Anubha -
[ANNOUNCE] Exadel's Max Katz talks about JSF and AJAX
Hello,
I'm pleased to announce that JSF Central has just published an interview with Exadel senior systems engineer Max Katz. In the interview, Max talks about the key value and benefits of JSF, how it compares to other frameworks, why it is such a good fit for AJAX, and support for JSF technology at Exadel.
Here's a quote:
KM: What do you think is the key value of JSF?
MK: It's definitely the component-based approach to building web applications, and that it's a standard. JSF has introduced a new paradigm to web application development�building applications out of components. It allows developers to concentrate on application business logic rather than on little details of HTML and other plumbing that is common to all web applications.
Being a standard is very important for the community, and it helps vendors like Exadel create advanced visual tools. The component-based approach also gave rise to vendors building web components, which also benefits developers. Instead of spending two weeks on integrating a calendar feature into your application, you can now get a calendar component and concentrate on the business problem you're trying to solve.
KM: Let's talk about AJAX for a moment. What do you think makes JSF such a good fit for AJAX?
MK: It's the component approach that makes AJAX such a good fit for JSF. You develop your application out of JSF components that provide AJAX functionality. This approach hides all the complexity of JavaScript and XML. Developers don't need to work with error-prone JavaScript making sure it works in all browsers. The AJAX JSF components are tested, ready-to-use components. From the developer perspective, there is really no difference between using the commandButton standard component and using the JSF AJAX drag-and-drop components. The AJAX component is simply a lot more sophisticated in what it does. You can add AJAX functionality in a matter of minutes by using such components. It's very powerful.
To see the rest of the article, visit
http://www.jsfcentral.com/articles/katz-06-16-06.html.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann
Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring http://www.JSFCentral.com - JavaServer Faces FAQ, news, and infoThe posted link led to a *404*.
I think I found the podcast and transcript under [article on JSFCentral.com|http://www.jsfcentral.com/listings/R2925?link] . Kito: is this the correct location?
Maybe you are looking for
-
Use of a alias in one subquery
Executing the command below it returns an error informing that "A1" is an invalid identification. select 1 as a1, (select a1 as b2 from dual) as b1 from dual Is not possible to create one alias and to use it in one subquery in the same command? It ex
-
HELP !!! Problem in R/3 trying to get a PDF on to Web Dynpro
Hi, I read a note about <b>How to get PDF on to Web Dynpro iView </b>, it was very helpfull, but the problem is in R/3 because I need that the Print Window do not open and send data direct to Web Dynpro. the code is: control_parameters-no_dialog =
-
Hi all, i am passing a field typpe ' I ' to the ALV_LIST function module. it is going for dump. its giving error in dump like... The current statement only supports character-type data objects. vkr.
-
Hi Experts, I have requirement to create bar code in smart form, the barcode format will be 39 full ASCII . I have tried to create a character format with this font but it is not available in smartstyles. Can you please help me how Can I create this
-
Mobility group between controller 4400 and virtual wlc
Hello everybody... I read the configuration guide about the 7.3 release. And I figured out that you will need a hash key for establishing a mobility group relation between a controller and a virtual controller. The 7.3 release for the 5500 series wor