Saturday, July 3, 2010

SPContext. What Is It? (More Complex Example)

Perform a query on the current site for cases where item IDs are greater than 100.

SPSiteDataQuery oSiteQuery = new SPSiteDataQuery();

oSiteQuery.Query = "<Where>" +
                                " <Gt>" +
                                " <FieldRef Name="ID" />" +
                                " <Value Type = "Number"> 100 </Value>" +
                                " </Gt>" +
                               "</Where>";

oSiteQuery.ViewFields = "<FieldRef Name="Title" />"

DataTable oQueryResults = SPContext.Current.Web.GetSiteData(oSiteQuery);
oQueryResults.TableName = "queryTable";
oQueryResults.WriteXML("C:\queryTable.xml");

SPContext. What Is It?

1.  Its a SharePoint Class.
2.  It represents the context in an HTTP request.

3.  We use SPContext to return context (background / situation / perspective)information about such objects as:


- Current Web App
- Current Site Collection
- Current Site
- Current List
- Current List Item

e.g:

-  SPWebApplication WebAppCur = SPContext.Current.WebApplication;
-  SPSite SiteCollCur = SPContext.Current.Site;
-  SPWeb WebCur = SPContext.Current.Web;
-  SPList ListCur = SPContext.Current.List;

Note:  Site represents SiteCollection and Web represents Site in SharePoint 2007.

Friday, June 25, 2010

Career Path

70-573 - MCTS:  Application Developer
70-576 - MCITP: Design and Developing SharePoint2010 Application

70-667- MCTS: SharePoint2010 Configuring
70-668 - MCITP:  SharePoint2010 Administrator

Thursday, June 24, 2010

Advance MOSS: Web Service

1.  UserProfileChangeService.GetUserCurrentChangeToken Method (User Profile Change)  http:///_vti_bin/UserProfileChangeService.asmx

2.  How to: Use the Web Service to Modify User Profile Data
http:///_vti_bin/userprofileservice.asmx

While studying for Advance Moss 2007 exam..I found...

  1. Connect a SQL Server 2005 Analysis Services Filter Web Part to an Excel Web Access Web Part
  2. Change workbook parameters in Excel Services
  3. Pivot Table in Excel - How to Create and Use Pivot Table
  4. Key Performance Indicators - KPI List and Web Parts - review
  5. Understanding the Report Center and Dashboards in SharePoint Server 2007 
  6. Create and publish Key Performance Indicators (KPIs)
  7. Create an Office Data Connection (ODC) file
  8. Publishing and Synchronizing Excel 2007 Tables to SharePoint Lists
  9. Using Excel Web Services in a SharePoint Web Part
  10. Core Class Library
  11. Microsoft.Office.Server.Utilities Namespace
  12. Microsoft.SharePoint.Portal.WebControls Namespace
  13. Microsoft.SharePoint.SoapServer Namespace
  14. Microsoft.Office.Server.WebControls Namespace
  15. UserProfileService.GetUserProfileByName Method (Microsoft.Office.Server.UserProfiles)
  16. GetCurrentChangeToken
  17. How to: Use the Web Service to Modify User Profile Data
  18. FormTemplateCollection Class
  19. Convert an InfoPath form to a Web page
  20. XmlFormView Class
  21. XmlFormView Methods
  22. XmlFormView.OnInit Method
  23. XmlFormView.XsnLocation Property
  24. XmlFormView.XmlLocation Property
  25. Walkthrough: Creating SharePoint 2010 Workflows in Visual Studio using InfoPath forms
  26. SPWorkflowTask Methods
  27. Using Extended Properties on Database Objects
  28. The BDC works with a Finder
  29. SharePoint language pack installation
  30. Everything You Need to Know about BDC: Part 5 of
  31. Implementing Incremental Crawling for BDC data
  32. AudienceCollection Class
  33. Create a hold to suspend records

    Must Watch!
  1. SharePoint Server 2007 Demo: Enable Excel Services

Wednesday, January 6, 2010

Oracle 10g: Create Temporary Table (sort of)

I've searched around and found out that oracle does not have specific built in function to create temporary table like the SQL server.  We need a little bit of creativity to create temporary table in oracle (sort-of). 

1.  Create a so-called temporary table (not so temporary..I don't really have time to control it dynamically through stored procedure)

CREATE TABLE RPTSTATLICSTATE_TEMP(
NEGERI varchar2(100),
NEGERIID integer,
KPM14A integer,
KPM15A integer,
KPM16A integer,
KPM17A integer,
KPM18A integer,
KPM19A integer,
KPM20A integer,
KPM21A integer,
KPM22A integer,
KPM23A integer,
KPM24A integer,
KPM25A integer,
KPM26A integer,
JUMLAH integer
)
 
 
2.  Create a stored procedure that will drop table if the table exist and recreate the temporary table.  The so-called temporary table will be dropped and created everytime the stored procedure being executed.
 
PROCEDURE SP_IFTableExist(tablename_ IN varchar2)
AS
     vCreate_ integer;
BEGIN


--1. Check whether table exists or not.
select count(*) into vCreate_ from user_tables where TABLE_NAME = 'RPTSTATLICSTATE_TEMP' ;

--2. If vCreate_ = 1; it means table exists...so...drop the table.
if vCreate_ =1 then
    EXECUTE IMMEDIATE 'Drop Table RPTSTATLICSTATE_TEMP';

end if;
EXECUTE IMMEDIATE 'CREATE TABLE RPTSTATLICSTATE_TEMP(  ' || 

' NEGERI varchar2(100),  '  ||
' NEGERIID integer, ' ||
' KPM14A integer, ' ||
' KPM15A integer, ' ||

' KPM16A integer, ' ||

' KPM17A integer, ' ||

' KPM18A integer, ' ||

' KPM19A integer, ' ||

' KPM20A integer, ' ||

' KPM21A integer, ' ||

' KPM22A integer, ' ||

' KPM23A integer, ' ||

' KPM24A integer, ' ||

' KPM25A integer, ' ||

' KPM26A integer, ' ||

' JUMLAH integer ' ||

') ';

--3. exception to cater error found.
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - ' ||SQLCODE||' -ERROR- '||SQLERRM);


END;

Tuesday, November 17, 2009

MOSS 2007: Post Reminder

Sorry...just need a place to remind myself to post some few stuffs out:

1. Lookup - calling data from other site's list. e.g: dropdown list.
2. Inner Join lists by using SharePoint Designer.
3. Creating Data View.
4. databinding when saving by using SharePoint Designer.
5. Linked Source in SharePoint Designer.
6. Insert data view in web part
7. Installing SQL Report Services

Sunday, September 13, 2009

MOSS2007: Backup and Restore Web App

Backup

1. Start > run > cmd


2. cd "C:\Program Files\Common Files\Microspoft Shared\web server extensions\12"


3. stsadm -o backup -url http://sharepoint2007:115/ -filename c:\backupssp115.dat


4. If successful this message will appear: Operation completed successfully.



Restore

1. goto Central Administration > Application Management > Create or Extend Web Application > Create A New Web Application > .....

2. After webapp being created goto Start > run > cmd

3.cd "C:\....12..hives"

4. stsadm -o restore -url http://sharepoint2007:115 -filename c:\backupsp115.dat -overwrite

5. If successful this message will come out: Operation completed successfully.




Wednesday, August 5, 2009

MOSS 2007: Installing Helpdesk Template

I tried to install this few times and finally I got the idea of installing it...

1. We have to install: ApplicationTemplateCore.exe to your sharepoint server. You may download it here. Click the exe file and extracted the file to a respective folder. A file called ApplicationTemplateCore.wsp will be extracted to that folder. You may refer to the visual steps from my previous post.

2. Open command prompt and do this:
  • stsadm -o addsolution -filename \ApplicationTemplateCore.wsp
  • stsadm -o deploysolution -name ApplicationTemplateCore.wsp -allowgacdeployment -local
  • stsadm -o copyappbincontent
...it should appear like this...

3. Next we install: HelpDesk.exe that can be downloaded from here. Again click the exe file and extracted the file to a respective folder. A file called HelpDesk.wsp will be extracted to that folder. You may refer to the visual steps from my previous post.

4. Open/Proceed with the command prompt and do this:
  • stsadm -o addsolution -filename \HelpDesk.wsp
  • stsadm -o deploysolution -name HelpDesk.wsp -allowgacdeployment -local
5. How to check whether the files have been deployed?
  • goto Start > All Programs > Microsoft Office Server >Sharepoint 3.0 Central Administration
  • Click the Operation Tab
  • Click Solution Management under global configuration.
  • Check under Deployed To header. If it states Globally Deployed...then type iisreset in your command prompt.
  • close your Central Administration Page..then reopen it back.