2009年10月16日 星期五
T-Mobile: WAP Setting
1:Rename Profile => T-MOBILE WAP
2:Home Page =>http://wap.myvoicestream.com
3:Data account :T-Mobile GPRS
4:Connection type:WAP
5:User Name:(none)
6:Password:(none)
Services => Data Account => GPRS => (chose an unused company name) =>
1:Change Account Name => T-Mobile GPRS
2:APN => wap.voicestream.com
3:User Name: (none)
4:Password:(none)
5:Auth.type: Normal
Primary DNS: 216.155.165.50
Secondary DNS: 216.155.165.51
2009年10月15日 星期四
Junit 4: Add Junit test on Ant
<target name="mytest" description="mytest">
<junit printsummary="yes" haltonerror="yes" haltonfailure="yes" fork="yes"> <formatter type="plain" usefile="false" />
<test name="gov.hud.mfh.business.service.contracts.ContractFinderTest"/> <classpath>
<pathelement path="test"/> <!-- source code place -->
<fileset dir="test"> <!-- source lib place -->
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
<fileset dir="./lib/junit"> <!-- junit lib place -->
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset> </classpath>
</junit>
</target>
You must Exclude ant*.jar otherwise you will get Error:
No tests found in gov.hud.mfh.business.service.contracts
And USE ANT 1.7.0 TO RUN JUNIT 4.
ANT 1.7.1 might has problem.
Batch Junit Example
<target name="batchtest" description="batchtest">
<junit printsummary="yes" haltonerror="no" haltonfailure="yes" fork="yes">
<formatter type="xml" usefile="true" />
<classpath>
<pathelement path="test"/>
<fileset dir="test">
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
<fileset dir="./lib/junit">
<include name="**/*.jar"/>
<exclude name="**/ant*.jar"/>
</fileset>
</classpath>
<batchtest fork="yes" todir="${reports.junit.dir}" haltonfailure="yes" >
<fileset dir="junit">
<include name="**/*Test*.java"/>
</fileset>
<formatter type="xml"/>
</batchtest>
</junit>
</target>
Junit 4: Error on JUnit4TestAdapter signer information
Solution: more than one junit.jar appear in the classpath. Please delete the redundant one.
2009年8月16日 星期日
Create Action in ActionMenu
2. Elements.xml:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Simple List Actions"
GroupId="ActionsMenu"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1101"
Title="My Action"
Description="A Simple Action Menu"
ControlAssembly="CustomActions.SimpleAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5483709352c77bd4"
ControlClass="CustomActions.SimpleAction.SimpleActionExample"/></Elements>
3. Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="886DFDD5-B323-4593-9471-717C863F4CB4"
Title="Custom Simple Action Example"
Scope="Web"
Hidden="FALSE"
>
<ElementManifests>
<ElementManifest Location="Elements.xml" />
</ElementManifests>
</Feature>
4. SimpleActionExample.cs
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using System.Diagnostics;
using System.Web.UI;
using Microsoft.SharePoint;
namespace CustomActions.SimpleAction
{
public class SimpleActionExample: System.Web.UI.WebControls.WebControl
{
protected override void OnLoad(EventArgs e)
{
EnsureChildControls();
base.OnLoad(e);
}
protected override void CreateChildControls()
{
SPWeb site = SPContext.Current.Web;
MenuItemTemplate _action = new MenuItemTemplate();
_action.Text = "My Action1";
_action.Description = "My Action1";
_action.ImageUrl = "/_layouts/images/NEWITEM.GIF";
_action.ClientOnClickNavigateUrl = "http://www.ttt.com";
Controls.Add(_action);
}
7. Deploy Descripture
cd "$(ProjectDir)"xcopy "$(TargetDir)*.dll" "C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin\" /ys"
%programfiles%\microsoft visual studio 8\sdk\v2.0\bin\gacutil" /i "$(TargetPath)" /nologo /f
xcopy "TEMPLATE" "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\" /ys
6. Deploy the feature.
stsadm -o deactivatefeature -name CustomSimpleAction -url http://site/ -force
stsadm -o uninstallfeature -name CustomSimpleAction -force
stsadm -o execadmsvcjobs
stsadm.exe -o installfeature -name CustomSimpleAction
stsadm.exe -o activatefeature -name CustomSimpleAction -url http://site/ -force
stsadm -o execadmsvcjobs
iisreset
Then you found the action is not comming out......
Why????
Answer is here. You have to put it on SafeControl.
<SafeControl Assembly="CustomActions.SimpleAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5483709352c77bd4" Namespace="CustomActions.SimpleAction" TypeName="*" Safe="True" />
Use
<?xml version="1.0" encoding="utf-8" ?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="C467C5CE-5290-4A2B-A243-092F5A51E4E0" >
<FeatureManifests>
<FeatureManifest Location="CustomActions.SimpleAction\feature.xml" />
</FeatureManifests>
<Assemblies>
<Assembly DeploymentTarget="GlobalAssemblyCache" Location="CustomActionOCRPDFInList.dll">
<SafeControls>
<SafeControl
Assembly="CustomActions.SimpleAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5483709352c77bd4"
Namespace="CustomActions.SimpleAction"
TypeName="*"
Safe="True" />
</SafeControls>
</Assembly>
</Assemblies>
</Solution>
Or directly put in Web.config file
2009年8月3日 星期一
Invalid postback or callback argument
EXCEPTION:
Invalid postback or callback argument. Event validation is enabled using in configuration or in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Just make sure EnableEventValidation is set to false on web.config, otherwise the following error is being thrown:
Hide Workflow Link on Item Context Menu for Document List
2. find the words: function AddDocLibMenuItems(m, ctx)
3. under the function, find words: AddWorkflowsMenuItem(m, ctx);
4. comment that out. or Add if (ctx.ListTitle != "Test Document") to focus on some list title.
5. Save it of course.
2009年6月11日 星期四
Set up SQL mail on SQL Server 2005
Solve the problem on "Enable the use of 'Database Mail XPs' by using sp_configure"
USE Master
GO
sp_configure 'show advanced options', 1
GO
reconfigure with override
GO
sp_configure 'Database Mail XPs', 1
GO
reconfigure
GO
sp_configure 'show advanced options', 0
GO
User for Imcomplete Survey
The only thing I can see is the user list with imcomplete survey and SQL is like:
select a2.nvarchar3, a2.nvarchar1, a2.nvarchar2, a2.nvarchar10, a2.nvarchar14, a1.tp_CheckoutUserId
from AllUserData a1
inner join AllUserData a2
on a1.tp_CheckoutUserId = a2.tp_ID
where a1.tp_ListId = 'A841EA21-20EC-4B79-AAC0-F1AD25F6278E'
and a1.tp_CheckoutUserId is not null and a2.tp_ContentType = 'Person' order by a2.nvarchar1
at 6/09/2009 09:32:00 AM
How to find ListTemplateId from a list
Select the list template you want to create.
Before you click Create Button, see the URL.
It should be something like http://site/_layouts/new.aspx?NewPageFilename=TEST%2Estp&FeatureId={00bfea71-3a1d-41d3-a0ee-651d11570120}&ListTemplate=120
and List Template ID is there.
at 6/02/2009 04:32:00 PM
Create "get Public Key"
Title: get &Public Key
Command: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe
Arguments: -Tp $(TargetPath)
Right click on the menu => Customize... => Categorize: Tools, External Comman 7...
at 5/14/2009 04:18:00 PM
PWA: Setting User and Group Permission
You should see the "Server Settings" on the left hand side if you have right to see it.
at 4/21/2009 01:08:00 PM
Install Caml dll
and GAC place.
at 4/17/2009 11:47:00 AM
VM Ware: Share File between host and virtual
2. Click menu "VM", then select "Settings";
3. Then click "Options" in the new window, and you will see an option "Shared folders Enabled" ;
4. Select it and add some folders;
5. OK, end.
at 3/25/2009 11:19:00 PM
SharePoint 2007: Error on add attachment
Failed to get value of the "Attachments" column from the "Attachments" field type control. See details in log. Exception message: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)..
You have double web parts using the same attachmentUpload. Check in html "view source", you will find two span tags "part1" or two attachment row. Please "Close" one web part.
at 3/11/2009 08:01:00 PM
Open pane tool section
javascript:MSOTlPn_ShowToolPane2Wrapper('Edit', this, '" + this.ID + "')
at 1/30/2009 08:44:00 AM
Oracle: ORA-12519, TNS:no appropriate service handler found on application processing
SOLUTION: under command window. RUN:
lsnrctl services
at 9/02/2008 10:59:00 PM
JAVA: list system properties
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
String value = (String)p.get(key);
System.out.println(key + " ***: " + value);
}
or if we want specific property
String classPath = System.getProperty("java.class.path",".");
System.out.println("classPath = " + classPath);
at 7/18/2008 08:40:00 AM
Javascript: Open in iFrame
style="position:absolute;display:none;background-color:white;border:solid 1px gray;border-style:double; z-index:100;"
in javascript
function showdiv(obj, bState, left, top) {
var oDiv = obj;
/*@cc_on @if (@_jscript_version >= 5)
try {
var oIframe = document.getElementById('HelpFrame');
oIframe.scrolling = 'no';
} catch (e) {
var oIframe = document.createElement('iframe');
var oParent = oDiv.parentNode;
oIframe.id = 'HelpFrame'; oParent.appendChild(oIframe);
}
oIframe.frameborder = 0;
oIframe.style.filter='Alpha(Opacity=80)';
oIframe.style.position = 'absolute';
oIframe.style.top = top;
//oIframe.style.left = left;
oIframe.style.display = 'none'; @end @*/
if (bState) {
oDiv.style.margin = "0px";
oDiv.style.padding = "0px";
oDiv.style.top = top;
//oDiv.style.left = left;
oDiv.style.display = 'block';
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.top = oDiv.style.top;
oIframe.style.left = oDiv.style.left;
oIframe.style.zIndex = oDiv.style.zIndex - 1;
oIframe.style.width = parseInt(oDiv.offsetWidth);
oIframe.style.height = parseInt(oDiv.offsetHeight);
oIframe.style.visibility = "visible";
oIframe.style.display = 'block'; @end @*/
} else {
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.display = 'none'; @end @*/
oDiv.style.display = 'none'; }
}
at 7/14/2008 03:55:00 PM
SharePoint: Install Report Service Add-in on SQL Server
*Click Start => Programs => Microsoft SQL Server 2005 => Configuration Tools.
*Click Reporting Services Configuration. The Report Server Installation Instance Selection dialog box appears so that you can select the report server instance you want to configure.
*In Machine Name, specify the name of the computer on which the report server instance is installed. The name of the local computer is specified by default, but you can also type the name of a remote SQL Server instance.
* In Instance Name, choose the SQL Server 2005 Reporting Services instance that you want to configure. Only SQL Server 2005 report server instances appear in the list. You cannot configure earlier versions of Reporting Services.
* Click Connect.
* Click Database Setup to open the Database Setup page.
* Enter the name of the SQL Server Database Engine you want to use.
* Click Connect.
* Click New.
* In the SQL Server Connection dialog box, enter a name for the new database.
* Select the Create the report server database in SharePoint integrated mode check box.
* Click OK.
* On the Database Setup page, specify the credentials that are used to connect to the report server database.
* Choose Service credentials to use the Windows service account and Web service account to connect through integrated security.
Choose Windows credentials to specify a domain user account. A domain user account must be specified as
Choose SQL Server credentials to specify a SQL Server login.
Click Apply.
Restart the Report Server Windows service.
at 7/14/2008 08:00:00 AM
CVS: Install on Linux Enterprice 5
Create new folder for CVS
1. Create folder under /opt called "cvs".
2. Copy the file cvs-1.11.23.tar.gz to /opt/cvs
3. Create folder under root called "cvs".
4. Create folder under /cvs called cvsroot
Create new group and user:
1. Create group cvs: groupadd cvs
2. useradd -g cvs -G cvs -d /cvs/cvsroot cvsuser
3. Add password: passwd cvsuser
Change folder owner and group to cvs and cvsuser
1. chgrp -R cvs /cvs
2. chown -R cvsuser /cvs
3. chmod 775 /cvs/cvsroot
Install CVS:
1. Go back to /opt/cvs (Should have the cvs-1.11.23.tar.gz in there)
2. Enter: gunzip cvs.tar.gz
3. Enter: tar -xf cvs.tar
4. Enter: ./configure
5. Enter: make
6. Enter: make install
Setup initial state in /cvs/cvsroot
Enter: cvs -d /cvs/cvsroot init (This will create a CVSROOT and related file under CVSROOT folder).
Create password for user:
1. Enter: vi /cvs/cvsroot/CVSROOT/passwdgen.pl
Content in file should be:
#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}\n";
2. Save it.
3. Create a encrypted password: For exampel if password in plant text is "test"
Enter: ./passwdgen.pl "test"
4. Enter: vi /cvs/cvsroot/CVSROOT/passwd
Content should be:
username1:encrptedpassword1:cvsroot
username2:encrptedpassword2:cvsroot
Create Service for CVS:
1. Enter: vi /etc/services
2. Add following tow line in proper placs and save it.
cvspserver 2401/tcp #pserver cvs service
cvspserver 2401/udp #pserver cvs service
3. Go to: cd /etc/xinetd.d
4. Enter: vi cvspserver
Content should be like this:
service cvspserver
{
disable = no
port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
#user = cvsuser
group = cvs
passenv = PATH
server = /usr/bin/cvs
#server = /opt/cvs/cvs-1.11.23
#env = HOME=/var/cvs
#server_args = -f --allow-root=/var/cvs pserver
server_args = -f --allow-root=/cvs/cvsroot pserver
# bind = 127.0.0.1
}
5. Save it.
6. Restart service: /etc/rc.d/init.d/xinetd restart
7. Check if cvs is running: netstat -l grep cvspserver
8. Result should be like this:
tcp 0 0 *:cvspserver *:* LISTEN
9. Log into CVS
cvs -d :pserver:username1@202.204.114.37:/cvs/cvsroot login
10. Set path
PATH=$PATH:/usr/bin
export PATH
CVSROOT=/home/cvsroot
export CVSROOT
If we want to move old projects to new projects.
1. Copy from old machine /cvs/cvsroot to new machine /cvs/cvsroot
2. Change group and owner:
chgrp -R cvs /cvs
chown -R cvsuser /cvs
SharePoint: Deploy/Remove new wsp feature
@SET STSADM=”c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe”
%STSADM% -o addsolution -filename OfficeSpaceFeature.wsp
%STSADM% -o deploysolution -name OfficeSpaceFeature.wsp -immediate -allowGacDeployment
%STSADM% -o execadmsvcjobs
if you get error
This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.
stsadm -o deploysolution -name OfficeSpaceFeature.wsp -immediate -allowgacdeployment -allowcaspolicies -url http://tt.it.com
stsadm -o upgradesolution -name PsiCntLib.wsp -filename PsiCntLib.wsp -immediate -allowGacDeployment
Remove
@SET STSADM=”c:\program files\common files\microsoft shared\ web server extensions\12\bin\stsadm.exe”
%STSADM% -o retractsolution -name OfficeSpaceFeature.wsp -immediate
%STSADM% -o execadmsvcjobs
%STSADM% -o deletesolution -name OfficeSpaceFeature.wsp
By the way deploye EVENT EVENT:
stsadm.exe -o installfeature -name EventHandlerFolderName
stsadm.exe -o activatefeature -name EventHandlerFolderName -url http://xxx/webname/ -force
stsadm -o execadmsvcjobs
stsadm -o deactivatefeature -name EventHandlerFolderName-url http://xxx/webname/
-force
stsadm -o uninstallfeature -name EventHandlerFolderName-force
stsadm -o execadmsvcjobs
--stsadm -o deletesolution -name EventHandlerFolderName-override
at 7/10/2008 07:52:00 AM
SharePoint PowerShell 2010
Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment
Remove-SPSolution–Identity MySharePointSolution.wsp
Working with features
stsadm –o deactivatefeature –name MyFeatureName –url http://myspwebapp
Disable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
Erorr for Spring configuration file
Error creating bean with name 'businessBeanFactory' defined in URL [file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-modules/contracts-ejb/beanRefContext.xml]: Instantiation of bean failed; ...
...to convert value of type [java.lang.String] to required type [org.springframework.context.ApplicationContext]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type
** Check Database conntection.
at 6/05/2008 06:55:00 PM
Disable back button on browser
at 5/13/2008 02:09:00 PM
Oracle: Error for ORA-16014 and some basic commands
C:/>sqlplus /nolog
SQL> conn username/password as sysdba
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-16014: log 2 sequence# 1383 not archived, no available destinations
ORA-00312: online log 2 thread 1:
'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG'
SOLUTION:
SQL> alter database clear unarchived logfile group 2;
SQL> shutdown immediate
Then startup database: (In windows service or do command as follow)
SQL> startup mount
By the way, stop archive use this
SQL> ALTER SYSTEM ARCHIVE LOG STOP;
at 4/23/2008 11:17:00 AM
Java Mail
import javax.mail.*;
import javax.mail.internet.*;
Properties property = new Properties();
property.put("smtp server", "test.com");
Session s = Session.getInstance(property,null);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("from@test.com");
message.setFrom(from);
InternetAddress to = new InternetAddress("to@test.com");
message.addRecipient(Message.RecipientType.TO, to);
message.setSubject("Test from JavaMail.");
message.setText("Hello from JavaMail!");
Transport.send(message);
at 2/14/2008 02:21:00 PM
Event ID Errors: 6398, and 6641 on Event Log
Try this:
Central Administration > Application Management > Check Services Enabled in this Farm > Check Services Enabled in this Farm
and see if any service has error on the page.
Then open IIS Manager, Go to Application Pools, check every application pool has wrong access user name and password.
at 2/07/2008 10:08:00 AM
Interrupt Upgrade SP service by getting "http://go.microsoft.com/fwlink?LinkID=96177"
USE master;
GO
EXEC sp_configure 'show advanced option', '1';
You can review it by using
EXEC sp_configure;
Then run =>Start/Program/Microsoft Office Server/Configures SharePoint Products and Technologies.
Someone also recommend to run command in command window
psconfig -cmd upgrade -force
Then run =>Start/Program/Microsoft Office Server/Configures SharePoint Products and Technologies.
at 2/06/2008 03:59:00 PM
2009年6月9日 星期二
Running Sun application server as a background service
Run command:
/opt/SUNWappserver/bin/asadmin start-domain --domaindir /opt/SUNWappserver/domains --user admin
Fail when you startup Application First time on UNIX
/var/appserver/domains is not a directory
when running:
asadmin start-domain domain1
mkdir /var/appserver (I didn't have to do this but maybe you do.)
mkdir /var/appserver/domains
asadmin create-domain --domaindir /var/appserver/domains --adminport 4848 --instanceport 8080 --adminuser admin domain1
Then you will see:
Please enter the admin password>
Please enter the admin password again>
Please enter the master password>
Please enter the master password again>
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Domain domain1 created.
asadmin start-domain domain1
and move on to confirmation.
at 12/27/2007 11:48:00 AM
SharePoint 2007: Hide Create at/Modified by on Display form
SharePoint 2007: Update global links Like My Links
Add a line
<td class="ms-globallinks"><a href="http://www.google.com">google</a></td>
under line
<td class="ms-globallinks"><asp:Literal id="hlMySiteSpacer" runat="server" /></td>
at 9/26/2007 06:09:00 AM
SharePoint 2007: Get Current Web, List ...
SPWeb currentSite = SPContext.Current.Web;
SPSite currentSiteCollection = SPContext.Current.Site;
SPWebApplication currentWebApplication = SPContext.Current.Site.WebApplication;
SPListItem item = (SPListItem)SPContext.Current.Item;
SPUser user = SPContext.Current.Web.CurrentUser;
at 8/23/2007 04:53:00 AM
Linux: start samba
go to /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
Go to startx to setup samba user.....(Mmm....)
/etc/init.d/smb restart
add new password on CVS
./passwdgen.pl username password groupname >> passwd
Firewall: go http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables
How To Start iptables
[root@bigboy tmp]# service iptables start
[root@bigboy tmp]# service iptables stop
[root@bigboy tmp]# service iptables restart
To get iptables configured to start at boot, use the chkconfig command:.
[root@bigboy tmp]# chkconfig iptables on
Determining The Status of iptables
You can determine whether iptables is running or not via the service iptables status command. Fedora Core will give a simple status message. For example
[root@bigboy tmp]# service iptables status
Firewall is stopped.
[root@bigboy tmp]#
at 7/18/2007 03:27:00 PM
No copy and paste on textfield
If you don't want anyone to paste on some field. Add attributeonpaste="event.returnValue=false;"
SharePoint 2007: Move Site
1. backup command:
stsadm -o backup -url http://sharepointdev:55 -filename c:\filename.dat
2. create a web application (Do not create site collection)
3. restore command:
stsadm -o restore -url http://sharepointdev:260 -filename c:\filename.dat -overwrite
Move sub site:
1. Save site to a template. How to? See http://itsmesunny.blogspot.com/2007/07/sharepoint-2007-save-as-site-template.html
2. Go to Site setting/Site Template. Click and save template to HD and copy to the other machine if machines are different. Then copy to the other machine.
3. Go to the new site. and use Site setting/Site template ot load to New web site.
4. Create a site and use new template as site template.
Or:
1. use command:
stsadm.exe -o export -url http://sharepointdev -filename c:\filename.dat
2. Move to the other machine.
3. use command:
stsadm.exe -o import -url http://sharepointdev -filename c:\filename.dat
at 7/06/2007 07:10:00 AM
SharePoint 2007: Save as site template
Example: if the site is http://mysite/
Use: http://mysite/_layouts/savetmpl.aspx
at 7/03/2007 08:09:00 AM
SharePoint: Add custom Master Page in Site definition
Copy Default.master to another one name myMaster.master.
Edit some layout if needed.
2. Create your own Site Definition. See http://itsmesunny.blogspot.com/2007/05/creating-custom-site-definition-in-mos
3. Edit ONET.xml under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[Your Site Template]\xml
...
<Configurations>
<Configuration ID="-1" Name="NewWeb" />
<Configuration ID="0" Name="Default" CustomMasterUrl="_catalogs/masterpage/myMaster.master">
...
<Configuration ID="1" Name="Blank">
...
</Configuration>
</Configurations>
<Modules>
<Module Name="CustomMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE" SetupPath="global">
<File Url="myMaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
</Module>
4.Edit Default.aspx under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[Your Site Template]\xml
<%@ Page language="C#" MasterPageFile="~masterurl/custom.master"
(Note: Don't change the name custom.master to your file name. It doesn't mean that)
at 5/17/2007 03:48:00 PM
Creating a custom Site Definition in MOSS 2007
2. Type in commend dcomcnfg. Choose Computer/My computer/DCOM config. Then right click on Microsoft Word Document
3. In Identity tab. check The interactive user. Then click OK.
4. Right click on My computer and choose Properties.
5. Under COM Security tab. Click Edit Default. Select user as following:
Access Permission:
SYSTEM
SELF
Everyone
Administrators
IUSR_(ServerName)
IWAM_(ServerName)
INTERACTIVE
Launch and Activation Permissions:
SYSTEM
Administrators
INTERACTIVE
Everyone
IUSR_(ServerName)
IWAM_(ServerName)
Then, most important thing. RESTART THE MACHINE.
at 5/17/2007 10:24:00 AM
SQL Mail setup with exchange server in SQL Server 2000
2. Setup mail in Outlook with exchange server. Remeber the Profile name we setting in the Outlook (Default may be named "Outlook").
3. Go to SQL Mail Configuration under Support Service in SQL Server 2000
4. Type in the profile name you setting in the Outlook. (You will found Error occur)
5. Go to Administrative Tools/Service. Find two services call SQLAgent and MSSqlServer.
6. Right click on this two service. In the Logon tab. Check This account. Type in the user's username, password and comfirm password.
Done!
at 4/26/2007 03:59:00 PM
Create Web Part "HelloWorld" to SharePoint 2007
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace HelloWork123
{
[Guid("a12d4678-34a5-4281-9d69-a3ab28a30c59")]
public class HelloWork123 : System.Web.UI.WebControls.WebParts.WebPart
{
public HelloWork123()
{
this.ExportMode = WebPartExportMode.All;
}
protected override void Render(HtmlTextWriter writer)
{
// TODO: add custom rendering code here.
writer.Write("Hello Hello Ha..Ha..Ha..");
}
}
}
Choose correct browser with URL. 5. Hit F5 to start debug. or go to cmd(command window), cd to your project location. For example, here is C:\dev\SharePoint\HelloWorld\HelloWork123\HelloWork123\bin\Debug>
at 4/05/2007 09:55:00 AM
JNDI on Sun Application Server 8.0
1. Go to sun application server and setting something like following:
2. create a java file: PropertiesFactory.java and save it like directory gov/hud/cpd/gmp/business/service
package gov.hud.cpd.gmp.business.service;
import java.util.Hashtable;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
public class PropertiesFactory implements ObjectFactory {
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception {
Reference ref=(Reference)obj;
Properties props = new Properties();
props.setProperty("username", (String)(ref.get("username").getContent()));
props.setProperty("password", (String)(ref.get("password").getContent()));
props.setProperty("sshhost", (String)(ref.get("sshhost").getContent()));
return props;
}
}
3. make a jar file(only this file) using comment under root folder in cmd:
jar cf ftpJndi.jar *.*
(Remember to restart sun application server.)
4. copy it to [sun folder]\AppServer\domains\domain1\lib\ext as a library
or add in classpath in program as library.
- If sun application server cannot find this factory class, It will directory return java.naming.Reference type in prop = (Reference) envCtx.lookup(dsName); below.
5. create another file in program like following:
package gov.hud.cpd.gmp.business.service;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public final class JndiConnector {
public static ftpConnectionDao getContextName() throws NamingException {
ftpConnectionDao ftpConn = null;
Properties prop = null;
try {
InitialContext ctx = new InitialContext();
String dsName = "FtpConnection";
Context envCtx = (Context) ctx.lookup("java:comp/env");
prop = (Properties) envCtx.lookup(dsName);
ftpConn = new ftpConnectionDao();
ftpConn.setUsername(prop.getProperty("username"));
ftpConn.setPassword(prop.getProperty("password"));
ftpConn.setSshhost(prop.getProperty("sshhost"));
} catch (Exception e) {
e.printStackTrace();
}
return ftpConn;
}
}
and dao file:
package gov.hud.cpd.gmp.business.service;
public class ftpConnectionDao {
private String username;
private String password;
private String sshhost;
public String getSshhost() {
return sshhost;
}
public void setSshhost(String sshhost) {
this.sshhost = sshhost;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
6. in web.xml
<resource-ref>
<description>Ftp JNDI Reference</description>
<res-ref-name>FtpConnection</res-ref-name>
<res-type>java.util.Properties</res-type>
<res-auth>Container</res-auth>
</resource-ref>
7. in sun-web.xml
<resource-ref>
<res-ref-name>FtpConnection</res-ref-name>
<jndi-name>FtpConnection</jndi-name>
</resource-ref>
3/30/2007 11:45:00 AM
Install SharePoint 2007
2. Install SQL Server 2005 SP2
3. Make sure SMTP and index server installed on the server. You may need to restart machine.
4. Install SharePoint: refer to http://mindsharpblogs.com/bill/archive/2006/06/27/1153.aspx
NOTE: Stop before create Web Application
5. Setup Outgoing email.
Central Administration > Operations > Outgoing E-Mail Settings
[Your exchange server]
From address: [administrator's email]
To address: [administrator's email]
6. Set Incoming Email
Central Administration > Operations > Incoming E-Mail Settings
Configure Incoming E-Mail Settings
Enable sites on this server to receive e-mail?
Settings mode:
Use the SharePoint Directory Management Service to create distribution groups and contacts?
E-mail server display address:mylist @
7. Start Office SharePoint Server Search Service
Central Administration > Operations > Services on Server > Office SharePoint Server Search Service Settings
Configure Office SharePoint Server Search Service Settings on server hqspsdev
Use this server for indexing content
Use this server for serving search queries
Reduced
8. Start Windows SharePoint Services Serch Service
Central Administration > Operations >Services on Server > Windows
SharePoint Services Search Service Settings
Configure Windows SharePoint Services Search Service Settings on server hqspsdev
Database Server
Database Name
9. Start Excel Calculation Services and Document Conversion Load Balancer Service
10. Start Launcher Service Setting
Load Balancer server:
Port Number:
at 3/12/2007 04:34:00 PM
DUMP TRANSACTION LOG on SQL Server
dump transaction test with no_log
DBCC SHRINKFILE(PSIWeb_log, 20)
BACKUP LOG PSIWeb WITH TRUNCATE_ONLY
DBCC SHRINKFILE(PSIWeb_log, 1)
GO
exec sp_detach_db 'PSIWeb', 'true'
exec sp_attach_single_file_db @dbname = 'PSIWeb',
@physname = 'C:\MSSQL7\Data\PSIWeb_Data.MDF'
at 3/06/2007 10:23:00 AM
Black list on Shopping Store.
It's terribly to have some shopping experience with some web shopping store. They have cheap price on the list but later on they will try some way to charge you more or they will say no stock if you don’t buy more.
- Bananaboatcamera.com
- BestPriceCameras.com
- ExpressCameras.com
- TheCameraPros.com
And some price comparison site doesn’t give right rate on the store.
- ShopCartUSA.com
So, there is a big risk to have a search on the Google. A “search engine” doesn’t mean a “search Good Site engine”, especially on Sponsored Links and AD section
SAMSUNG T619: Make my own mp3 Ringtone
On Quicktime Pro:
Open file/[audio file].
Export file/movie to 3gp
In the dialog window, Select Audio tab.
Audio Format - AAC-LC (Music)
Data Rate - 64kbps
Channels - Stereo
Output Sample Rate - 44.1khz
Encoding quality - Best.
On Samsung PC Studio:
Get into Media management.
Select all media. Right click on frame and select Get From PC..
Choose 3gp file and import into phone.
On phone:
menu/fun & app/my sound/music/.../set as/ringtone
DONE!
2/01/2007 02:22:00 PM
SQL Server: export Resultsets into Text file and Retrieve back
execute master.dbo.xp_cmdshell 'osql -S10.1.1.6 -E -Q"execute PSIWebV3.dbo.sp_Test" -o"c:\temp\sp_out.txt" -s"" '
insert into #errorlog
execute master.dbo.xp_cmdshell 'type "c:\temp\sp_out.txt" '
select line from #errorlog
at 1/19/2007 05:18:00 PM
JavaScript: Automatically popup window on saving file
a jwcid="helpWindow" onClick="var helpwindow=window.open(this.href,'helpwin','width=650,
height=450,left=100,top=100,resizable=yes,scrollbars=yes');
helpwindow.focus();return false">Help/a>
at 1/10/2007 04:19:00 PM
Add/Update/Delete/Select comment on SQL Server 2000
EXEC sp_updateextendedproperty 'MS_Description', 'Employee ID', 'user', dbo, 'table', employee, 'column', empId
EXEC sp_dropextendedproperty 'caption', 'user', dbo, 'table', 'employee', 'column', empId
SELECT *
FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'employee', 'column', default)
at 1/03/2007 10:23:00 AM
Sun Application Server 8.2 with jconsole on JVM
Go Configuration/Admin Service/System.
See the port setting....
In comment line window, type in jconsole and Enter..
Set port as same as the port provide upper.
Running Ant for cvs difference
Posted at 9/28/2006 09:17:00 AM 0 comments
Library 'tacos' not found in application namespace.
< id="tacos" path="classpath:/net/sf/tacos/Tacos.library">
at 9/13/2006 10:00:00 PM
Directly set maxlength on Form object from database
SQL = "select syscolumns.name as colname,syscolumns.length as collen, "
SQL = SQL & "systypes.name as typename from syscolumns, systypes "
SQL = SQL & " where object_name(syscolumns.id) = 'survey'"
SQL = SQL & " and syscolumns.xtype = systypes.xtype"
SET qs = Conn.Execute(SQL)
ind = 1
If not qs.EOF Then
Do While NOT qs.EOF
Execute( qs("colname") & "=" & qs("collen"))
ind = ind + 1
qs.MoveNext
Loop
End If
qs.Close
9/03/2006 09:52:00 PM
HTML STYLE: Menu or Layer will orverlapping Form Element
&lttr><td align="center"> <br>
> a href="JavaScript:showDiv('DivReviewPurpose', false);">
Close Window
In Script
function showDiv(sDivID, bState, tableWidth, tableHeight, p) {
var oDiv = document.getElementById(sDivID);
/*@cc_on @if (@_jscript_version >= 5)
try {
var oIframe = document.getElementById('HelpFrame');
oIframe.scrolling = 'no';
} catch (e) {
var oIframe = document.createElement('iframe');
var oParent = oDiv.parentNode;
oIframe.id = 'HelpFrame'; oParent.appendChild(oIframe);
}
oIframe.frameborder = 0;
oIframe.style.position = 'absolute';
oIframe.style.top = 0;
oIframe.style.left = 0;
oIframe.style.display = 'none'; @end @*/
if (bState) {
//oDiv.style.margin = "0px";
//oDiv.style.padding = "0px";
oDiv.style.width = tableWidth + "px";
oDiv.style.height = tableHeight + "px";
oDiv.style.top = p.y + "px";
oDiv.style.left = p.x + "px";
oDiv.style.display = 'block';
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.top = oDiv.style.top;
oIframe.style.left = oDiv.style.left;
oIframe.style.zIndex = oDiv.style.zIndex - 1;
oIframe.style.width = parseInt(oDiv.offsetWidth);
oIframe.style.height = parseInt(oDiv.offsetHeight);
oIframe.style.display = 'block'; @end @*/
} else {
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.display = 'none'; @end @*/
oDiv.style.display = 'none'; }
} //
Wednesday, August 02, 2006
MS Access Select List will actually update data
ANSWER:
1. Don't set anything on Control Source on Select List's properties.
2.
Private Sub Form_Load()
Me.Combo0.Requery
Me.Combo0 = Me.Combo0.ItemData(0)
End Sub
at 8/02/2006 02:35:00 AM 0 comments
Log for using AJAX
EmpReviewUpd.asp
EmpReviewUpd_xt.asp
EmpReviewCommendAjax.js
to see the example
Hibernate: Get Length and Type attribute from property on mapping file using JAVA
public Configuration getConfiguration() {
Configuration configuration = new Configuration();
setMappings(configuration);
Iterator classMappings = configuration.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass cm = (PersistentClass) classMappings.next();
Iterator propertyIterator = cm.getPropertyIterator();
while (propertyIterator.hasNext()) {
Property element = (Property) propertyIterator.next();
//Logger.debug(cm.getEntityName() + " = " + element.getName());
Iterator columnIterator = element.getValue().getColumnIterator();
while (columnIterator.hasNext()) {
Column col = (Column) columnIterator.next();
//Logger.debug(col.getName() + " > " + col.getLength());
}
}
}
return configuration;
}
private void setMappings(Configuration configuration) {
String[] files = new String[] { "AvailabilityCode", "StateCode",
"StatusCode", "SuitabilityCode", "ReasonCode", "Property",
"PropertyHistory", "Publication", "Agency", "PasswordHistory",
"UnsuitableReason", "User", "PropertyNumberSequence",
"FieldOfficeCode", "FieldOfficePoc", "DodDepartment",
"BracApplication", "Contact", "ContactType" };
for (int i = 0; i <>
at 6/09/2006 05:25:00 PMHibernate is slow with JRE 1.5
Hibernate is slow with JRE 1.5. We still don't know why, but the fact is SLOW. We wrote a native SQL instead of Hibernate SQL to generate complexes SQL command. Following is record from Steve's Email:
We found out what the problem was attributed to. It was a very strange and quite frankly a misleading performance issue within Hibernate during the loading of the resultset into memory. We couldn’t pinpoint why it was failing (so slow), but were able to narrow down by a process of elimination (poor elimination). It turns out that we know the issue is one of two things:
· Running Hibernate on Solaris
· Running Hibernate using JDK 1.5
We really don’t care what the issue is because we’ve figured out how to tweak the code and fixed the problem.
Posted by Sunny Young at 5/31/2006 07:43:00 PM
Tapesty group pick up my question.
for (i = 11; i< 14; i++) {
myImage = document.getElementsByTagName('img')[i];
if (myImage != null && myImage != 'undefined') {
if (myImage.src.indexOf('arrow-up.gif')>0) {
myImage.setAttribute('alt','Sort Ascending');
} else if (myImage.src.indexOf('arrow-down.gif')>0) {
myImage.setAttribute('alt','Sort Descending');
}
}
}
Posted by Sunny Young at 5/31/2006 01:53:00 PM
Tapestry: LinkSubmit problem for browsing back
The way to fix it:Copy the LinkSubmit.jwc and LinkSubmit.java file from Tapestry. Rename it and extend to LinkSubmit.java
// make sure the submit function is on the page (once)
if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
{
Add This =>>body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
body.addBodyScript("function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null form.onsubmit()) form.submit(); }");
cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);}
Please refer this to http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-dev/200506.mbox/%3C594252918.1118656487914.JavaMail.jira@ajax.apache.org%3E
Posted at 5/25/2006 08:10:00 PM
Release Project Procedure
-
Update Label
-
Run label (.bat) file
-
Base on CVS Diff, write the release note
-
Posted at 5/25/2006 07:54:00 PM
Migration db from Production to Local
Export data from production (configuration is from "property" file)to local though SQL Server/import
-
Export data to cache ant -f migration.xml save-export
-
Commit export-data.zip to CVS
To import into database use ant -Denvironment=qa migrate-db-cached
Posted at 5/25/2006 05:58:00 PM 0 comments
Cannot logon to Microsoft Shared Point on Windows 2003
Posted at 5/24/2006 11:05:00 AM
Baseball Ticket
Posted at 5/22/2006 02:02:00 PM