Monday, September 17, 2012

Interwoven Teamsite Form publisher.

Interwoven's TeamSite product includes a feature called FormsPublisher. This is useful for scenarios where an information worker needs to contribute to the web site, but lack HTML and CSS skills. This type of user can complete a form, let the system validate it, and then press a button to have the system generate the equivalent HTML page.
The form can include validation, business logic, database queries or anything else you can dream up. While an HTML expert would prefer their favorite text editor and complete control to the HTML page. An information worker without HTML skills can now edit an existing page, based on an customized form. Now the challenge shifts to having the information worker select the appropriate form to build the page.

A developer configures a set of files and folders to support this process. At a high level, there are three parts in motion. The Data Capture Template (DCT) is an XML file that describes how TeamSite should present the form to the information worker. A Data Content Record (DCR) is an XML file that contains an instance of a form completed by an information worker. You launch TeamSite, click File, New Form Entry and select the form you want to complete. Next, the given form appears in the browser. The fields of the form are defined by the DCT. After you click the Save button, the field values are serialized into a DCR file. These files are organized in a collection of folders on the TeamSite server; one folder per form. Each folder has a conventional set of child folders to hold the DCR files as well as the presentation template file(s), These are the files with the .tpl file extension.
A presentation template converts a DCR into something else. Most of the time, at least for me, that something else will be an HTML page. Imagine a single DCR file that contains both public and private information for a company; perhaps the DCR contains public information about a single product as well as private information for their tech support staff. The DCR file can be send around via workflow for approval and the finally be ran through both sets of presentation templates which results in two different HTML files - one file is deployed to the public and the other file is kept on the Intranet. Both files are assured of having the appropriate content via the approval process and the presentation templates apply the correct branding and layout. This model supports a good workflow model as well as good separation of design from content. Its just one example of using the FormsPublisher in the enterprise.


Tuesday, September 4, 2012

Sql Triggers

As a simple definition we can say that
" A trigger is a database object that is attached to a table"

Triggers is  only fired when an INSERT, UPDATE or DELETE occurs in any Data base table.We specify the action to fired the trigger. As per example.

SET NOCOUNT ON

CREATE TABLE Student (St_ID int IDENTITY, St_Desc varchar(10))
go
CREATE TRIGGER tr_Source_INSERT
ON Student
FOR INSERT
AS
PRINT GETDATE()
go
INSERT Student (St_Desc) VALUES ('Test 1')

-- Results --

Apr 28 2001  9:56AM
 
Another example of triggers will be clear the idea.
 
CREATE TABLE Orders (Ord_ID int IDENTITY, Ord_Priority varchar(10))
go
CREATE TRIGGER tr_Orders_INSERT
ON Orders
FOR INSERT
AS
IF (SELECT COUNT(*) FROM inserted WHERE Ord_Priority = 'High') = 1
 BEGIN
  PRINT 'Email Code Goes Here'
 END
go
INSERT Orders (Ord_Priority) VALUES ('High')

-- Results --

Email Code Goes Here 

Triggers make use of two special tables called inserted and deleted.
 The inserted table contains the data referenced in an INSERT before it 
is actually committed to the database. The deleted table contains the 
data in the underlying table referenced in a DELETE before it is 
actually removed from the database. When an UPDATE is issued both tables
 are used. More specifically, the new data referenced in the UPDATE statement is contained in inserted and the data that is being updated is contained in deleted.

Sunday, November 13, 2011

Different Test Style By Java Script.

Hi,
Java script provide different in built function for editing the output of Test Format like.
<html>
<body>

<script type="text/javascript">

var txt = "Hello World!";

document.write("<p>Big: " + txt.big() + "</p>");
document.write("<p>Small: " + txt.small() + "</p>");

document.write("<p>Bold: " + txt.bold() + "</p>");
document.write("<p>Italic: " + txt.italics() + "</p>");

document.write("<p>Fixed: " + txt.fixed() + "</p>");
document.write("<p>Strike: " + txt.strike() + "</p>");

document.write("<p>Fontcolor: " + txt.fontcolor("green") + "</p>");
document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>");

document.write("<p>Subscript: " + txt.sub() + "</p>");
document.write("<p>Superscript: " + txt.sup() + "</p>");

document.write("<p>Link: " + txt.link("http://www.w3schools.com") + "</p>");

document.write("<p>Blink: " + txt.blink() + " (does not work in IE, Chrome, or Safari)</p>");

</script>

</body>
</html>

Just try this and I hope you will got some new.

Wednesday, November 9, 2011

How to convert Xml in to Html (xHtml)

Hi today i got the idea how we can convert our xml page in to xhtml . Its quit simple as just like  css style sheet is uses to decorate html page.
The major different in the process just here we are use xsl (xml style sheet ) instead css. This can be done by the help of  Xslt (xml style sheet transformation ).
Here i am post the example (Its a xml page where we give href relation with xsl plae like.

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
  </cd>
</catalog>
And the code of  cdcatalog.xsl is here
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <h2>My CD Collection</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th>Title</th>
      <th>Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
The reference of style sheet already given in the top header of xml page.

 <xsl:template match="/"> :-- Describe that we are apply style sheet in whole xml page due to match attribute match="/"


<xsl:for-each select="catalog/cd"> :-- Its reach all the nodes under the catalog .

Hi.... an another example of Converting xml in to Html
My Student.xml page code
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="student.xsl"?>

<student>
          <Roll_number>
                        <Name>Deepak Sharma</Name>
                        <Class>5th</Class>
                        <Year>2010</Year>  
          </Roll_number>
          <Roll_number>
                        <Name>Arun Sharma</Name>
                        <Class>5th</Class>
                        <Year>2011</Year>  
          </Roll_number>
          <Roll_number>
                        <Name>Mohit Sharma</Name>
                        <Class>5th</Class>
                        <Year>2010</Year>  
          </Roll_number>

</student>
Just check it that i have already mention student.xsl in there head session.
The code of student.xsl is.....
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
          <table><tr>
                 <th>Name</th><th>Class</th></tr>
                  <xsl:for-each select="student/Roll_number">
                 <tr><td><xsl:value-of select="Name"/></td><td><xsl:value-of select="Year"/></td></tr>
                 </xsl:for-each>
          </table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The xml style sheet flow chat like that....
1.<xsl:stylesheet version="" href="" ?></xsl:stylesheet>
2.<xsl:template></xsl:template>
3.<xsl:for-each></xsl:for-each>
4.<xsl:value-of select="">
Thanks




Tuesday, November 8, 2011

What is Xml NameSpace

Hi
I am start with some xml example let check this out......
<table>
  <tr>
    <td>Apples</td>
    <td>Bananas</td>
  </tr>
</table>
And another example of xml is
<table>
  <name>African Coffee Table</name>
  <width>80</width>
  <length>120</length>
</table>
As per the example both xml tag start with Table tag . so when we combined to gather there may be the chance of conflict.
An XML parser will not know how to handle these differences.

We can resolve the problem by Tar prefix like 
<h:table>
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>

<f:table>
  <f:name>African Coffee Table</f:name>
  <f:width>80</f:width>
  <f:length>120</f:length>
</f:table> 
The namespace is defined by the xmlns(xml namespace) attribute in the start tag of an element.
The namespace declaration has the following syntax. xmlns:prefix="URI".

<h:table xmlns:h="http://www.w3.org/TR/html4/">
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>

<f:table xmlns:f="http://www.w3schools.com/furniture">
  <f:name>African Coffee Table</f:name>
  <f:width>80</f:width>
  <f:length>120</f:length>
</f:table>
When a namespace is defined for an element, all child elements with the same prefix are associated with the same namespace.
Namespaces can be declared in the elements where they are used or in the XML root element:
<root
xmlns:h="http://www.w3.org/TR/html4/"
xmlns:f="http://www.w3schools.com/furniture"
>

<h:table>
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>

<f:table>
  <f:name>African Coffee Table</f:name>
  <f:width>80</f:width>
  <f:length>120</f:length>
</f:table>

</root> 

Namespaces in Real Use

XSLT is an XML language that can be used to transform XML documents into other formats, like HTML.
In the XSLT document below, you can see that most of the tags are HTML tags.
The tags that are not HTML tags have the prefix xsl, identified by the namespace xmlns:xsl="http://www.w3.org/1999/XSL/Transform":

Thanks It all about xml namespace . I will  post further in our next session.



Wednesday, October 12, 2011

How to integrate CSS in XML file.

Here i m showing some xml file test like...........

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/css" href="catalog.css"?>
<CATALOG>
  <CD>
    <TITLE>Empire Burlesque</TITLE>
    <ARTIST>Bob Dylan</ARTIST>
    <COUNTRY>USA</COUNTRY>
  </CD>

</CATALOG>
In the above line i have mention there how to include css file reference with href tag
Now question is that how to declare the css property .
css file format here.

CATALOG
{
background-color: #ffffff;
width: 100%;
}
CD
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
TITLE
{
color: #FF0000;
font-size: 20pt;
}
ARTIST
{
color: #0000FF;
font-size: 20pt;
}
COUNTRY
{
display: block;
color: #000000;
margin-left: 20pt;
}
Then its automatically worked with xml.
Thanks