http://www.joomlaspan.com/general/include-any-module-within-content-in-joomla-15.php
Search This Blog
Thursday, January 28, 2010
Monday, January 25, 2010
Create a SharePoint workflow history entry
public void CreateWorkflowHistoryEntry(string Outcome, string Description, string OtherData)
{ SPWorkflow.CreateHistoryEvent(workflowProperties.Web, workflowProperties.WorkflowId, (int)SPWorkflowHistoryEventType.WorkflowComment, this.workflowProperties.OriginatorUser, new TimeSpan(1), Outcome, Description, OtherData);
}
Tuesday, January 19, 2010
Joomla articles not updating
I was adding a new div in joomla articles but whenever i saved or applied the changes, all my changes reverted back and the div was lost from even the html source of the article. I spent almost 3 hours searching n trying different stuff.
The problem was that joomla articles dont allow empty divs
so:
<div class=”abc”></div>
would never show up neither be saved in the code
so i changed it to
<div class=”abc”> </div>
Enable remote access on Joomla Jumpbox Database
We have to enable remote access on a joomla jumpbox db in order to access it from the GUI tools which are installed on my actual machine (While jumpbox is in a VM on my actual machine)
On your VMWare player, click Alt + F1 to go to the console:
In console, write the following to get the root password:
sudo grep root /jumpbox/lib/appdata.yml
You will see a line such as the following:
root: pa$$word
where pa$$word is the password of your root user
To start using the db as the root user:
mysql -u root -p
#or
mysql -u root -ppa$$word
In order to allow remote access on the database, do the following:
sudo nano /etc/mysql/my.cnf
Find the bind-address property, and replace it with the IP of your jumpbox
e.g. I modified
#bind-address = 127.0.0.1
to
#bind-address = 192.168.1.36
Restart mysql:
sudo /etc/init.d/mysql restart
Now grant all privileges to a remote db user
GRANT ALL PRIVILEGES ON *.* TO ria@'%' IDENTIFIED BY 'ria0';
where ria is the user name, and ria0 is the password of a remote user (this user need not be already existing in the db, it creates a new user if it does not exist)
Now download the GUI tools for mysql and try accessing the db using
db host: 192.168.1.36 (your jumpbox host)
user: ria
pw: ria0
I started receiving an error saying
host 'mycomputername' is not allowed to access this mysql
(I dont remember the exact error string sorry)
To solve this problem, i went back to the console and ran this command:
GRANT ALL PRIVILEGES ON *.* TO ria@'mycomputername' IDENTIFIED BY 'ria0';
(We can also use IP of the external machine instead of the computer name)
Now you will be able to access the joomla jumpbox database externally.
http://wiki.jumpbox.com/doc/runtime/faq/access_mysql
http://www.jumpbox.com/node/1101
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
Monday, January 18, 2010
Using kickstart to restore a backup on jumpbox site
- Browse to kickstart.php
- choose a backup to restore from the dropdown
- choose ftp mode
- localhost
- port 21
- user
- password
- initial directory :- /
- Click Start
- When it asks for the db access:
- Host: enter the IP of your jumpbox e.g. 192.168.1.36
- user: user which has remote access enabled on the db
- password
- database name: (I was using the db of the existing site but it was giving me could not find the database error, so i created a new empty db and gave its name here, then the restore continued)
Set up Joomla kickstart on JumpBox
While using WAMP, you can install kickstart this way:
I placed my Joomlapack archive file in the WWW directory of my WAMP.
I copied the extraced Kickstart files there.
I extracted the archive file into the WWW directory.
Then I went to http://localhost/administrator and a new Joomla installation began.
At the end of the installation, there was my site.
While using Jumpbox:
I installed Joomla pack on my joomla site, and then i extracted the contents of Kickstart in /storage/joomla15/
Also placed the backup file in the same folder. Then I browsed
http://192.168.1.36/kickstart.php
Thursday, January 14, 2010
autochk program not found – AUTOCHECK skipping
I resolved it by Start > Run > sfc /scannow
http://www.techspot.com/vb/topic7746.html
http://www.windowsbbs.com/windows-xp/46438-autochk-program-not-found.html
Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type
Wrong Declaration
char CopiedString[];
char[] CopiedString;
Correct Declaration
char[] CopiedString = new char[3];
char[] CopiedString = xyz;
http://dotnetdud.blogspot.com/2008/08/bad-array-declarator-to-declare-managed.html
"One or more field types are not installed properly. Go to the list settings page to delete these fields."
I received this error while using an SPQuery CAML query string. the problem was that I had renamed my Title column in the list to “Document Library Name” and in the SPQuery i was using
query.Query = "<Where><Eq><FieldRef Name='Document Library Name'/><Value Type='Text'>" + this.workflowProperties.List.Title + "</Value></Eq></Where>";
after some research I found out that the internal name of the column was still ‘Title’ so i used
query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + this.workflowProperties.List.Title + "</Value></Eq></Where>";
and the error was gone :D
Wednesday, January 13, 2010
Create Folder using .NET
System.IO.Directory.CreateDirectory(@"c:\NewFolder");
System.IO.Directory.CreateDirectory(@"c:\NewFolder\NewSubFolder");
Sharepoint feature receiver
http://www.nnihlen.com/blog/archive/2006/12/04/724.aspx
http://code-journey.com/2009/07/05/add-an-event-handler-feature-receiver-to-a-sharepoint-feature/
http://ivydotnet.spaces.live.com/blog/cns!F0ADF64956CA5930!291.entry
http://blog.tylerholmes.com/2008/03/walkthrough-creating-sharepoint-feature.html
http://dkeeling.spaces.live.com/blog/cns!1FF0B17B869C973!146.entry
Integrated Features not enabled in Virtual PC – Windows 7
I kept on receiving an error while trying to enable the integration features with virtual pc in windows 7.
with some R&D, I found out tht the administrator of the virtual PC had an empty password. So i set a password for that user.
Added my own user (which i was using to login to the VM) to remote users group and ensured that the VM allowed remote access
Document Library to FTP Upload
Private Sub onWorkflowActivated1_Invoked(ByVal sender As System.Object, ByVal e As System.Workflow.Activities.ExternalDataEventArgs)
Try
Dim request As FtpWebRequest = CType(WebRequest.Create(ConfigurationManager.AppSettings("FTPHost") + Me.workflowProperties.Item.File.Name), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("FTPUser"), ConfigurationManager.AppSettings("FTPPassword"))
Dim webCl As WebClient = New WebClient()
webCl.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("SPUser"), ConfigurationManager.AppSettings("SPPassword"))
Dim buffer() As Byte = webCl.DownloadData(ConfigurationManager.AppSettings("CurrentSite") + Me.workflowProperties.Item.File.Url)
request.GetRequestStream().Write(buffer, 0, buffer.Length)
request = Nothing
Catch ex As Exception
End Try
End Sub
Tuesday, January 12, 2010
The requested URI is invalid for this ftp command
http://www.eggheadcafe.com/community/aspnet/2/60622/ftp-uri-invalid.aspx
http://forums.asp.net/p/1233240/2242751.aspx#2242751
Uri target = new Uri("ftp://ftp.placer.dyndns.org/test.css");
URI formats are not supported.
I was using File.OpenRead(xyzURL) when i received this error. the solution was to use a webclient
‘Access denied’ when deploying VS 2k8 Sharepoint workflow
(I couldnt get a resolution to this error but following is a workaround)
1. Create a directory in the features directory [C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\FEATURES] and drop both the feature.xml and workflow.xml files into the directory.
2. Install the feature on your farm, using the following command line statements
stsadm -o installfeature -name <<name>>
4. Activate the feature to a site collection
stsadm -o activatefeature –name <<name>> -url <<url>>
Replace <<name>> and <<url>> with the actual value
http://www.codeproject.com/KB/WF/sharepointworkflow.aspx?msg=2656569
***EDIT: Strange enough, I added System.Configuration reference in the project for some other purpose; and this error was gone :D
Monday, January 11, 2010
document.createElement not working on Firefox
document.createElement was working in all browsers other than FF.I changed this part
1: var newElement = document.createElement("<input name='"+elementName+"' id='" + elementName + "' type='hidden'>");
to this:
1: var newElement = document.createElement("input");
2: newElement.setAttribute('name',elementName);
3: newElement.setAttribute('id',elementName);
4: newElement.setAttribute('type','hidden');
and i got it working in all browsers
http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
http://www.eggheadcafe.com/community/aspnet/3/41127/firefox-createelement--a.aspx
Thursday, January 7, 2010
Wednesday, January 6, 2010
Call server side methods from client side
I know of some ways to do the above but this was really one of the simplest ways to do it.
http://usmanshabbir.blogspot.com/2009/10/simplest-way-to-call-server-side.html