function to get dcrpath in perl for interwoven teamsite

sub getDcrPath{
    debug("getDCRPATH CALLED");
    my $currentDcrName=shift;
       debug("dcr path: $currentDcrName");
    $currentDcrName=~ s/(.*WORKAREA\/)(.*?\/)/$1$2/;
    my $workareaName=$2;
    $workareaName=~s/\///g;
    #my $dcrPath="$iwmount/default/main/$branchName/$subBranchName/WORKAREA/$workareaName/templatedata/content/Fragments/data/";
    debug("WORKAREA ".$workareaName."==".$currentDcrName);
    return $workareaName;
}
hi friends here iam sharing a subroutine for reading a datacapture template in interwoven teamsite using perl script. hope this subroutine will help your requirement.


sub readDatacapture
{   

    debug("ENTERING READ DATACAPTURE FUNCTION");
    my $dctFile = shift;
   
    open INPUT, "<$dctFile";
    my @output_string = ;
    close INPUT;
    #debug("\n\n");
    foreach my $line(@output_string) {
       
        if ( $line =~ /.*command.*/ ) {

            #grab just the command itself
            my @fields2 = split /=/, $line;
            my $inlineCmd = @fields2[$#fields2] ;
            $inlineCmd =~ s/\/\>//; #strip off trailing tag
            $inlineCmd =~ s/\"//g; #strip off quotes

            #print "XXX" . $inlineCmd . "XXX\n";
            my @Results = `$inlineCmd 2>&1`;
            my $Result = join ('', @Results);
            chomp ($Result);   

            #remove the double substitution tags, since it maybe a normal inline that has substitution on it
            $Result =~ s/\//;
            $Result =~ s/\<\/substitution\>//;

            #remove xml declaration that would normally come across an inline
            $Result =~ s/\<\?xml.*\>?//;

            #Now substitute result for inline command
            print $Result;
            #debug("The result of $inlineCmd ");
            #debug("$Result");
           
           
        }
        else
        {   
            #print " IN ELSE ========== > $line\n";
            print $line;
            #debug("$line");
           
           
        }
    }
    #debug("\n\n");
    debug("EXITING READ DATACAPTURE FUNCTIONNNNNNN");
}
in interwowen teamsite we can able to integrate java applications with content.Teamsite content management system is more efficient than other different cms available now.Today i will explain how we can create html pages with content and how we are storing that content in cms and how we integrating that pages with java applications.

in teamsite , for creating a html we need that html data(data contains any information together with page contents and html tags).first we need to capture this data/content in an xml format.For capturing data in teamsite we are using some templates ,called datacapture template.
With the help of datacapture template we are storing our content in xml format.

The points to be remebered before starting page generation in teamsite.

1)create entry in templating.cfg for the new datacap
hai friends here iam sharing some pictures which i take during the Jesus Youth International Jubilee conference 2010.

JESUS YOUTH JUBILEE CONFERENCE 2010 PHOTOS











jesus youth jubilee conference photos
hai friends today iam sharing some example to convert a pdf file to jpeg using java program. below java program will helpful to convert a pdf document to jpeg or jpg image.i think this code will helpful to somebody who want to convert pdf to jpeg file.

package johnmukkad.tk;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;

import multivalent.Behavior;
import multivalent.Context;
import multivalent.Document;
import multivalent.Node;
import multivalent.std.adaptor.pdf.PDF;

public class PDFToJPEG extends HttpServlet {

public PDFToJPEG(){

}
/*public static void main(String args[]) {
File outfile = new File("file1.jpg");

try {

PDF pdf = (PDF) Behavior.getInstance("AdobePDF", "AdobePDF", null,
null, null);
File file = new File("test2.pdf");
pdf.setInput(file);

Document doc = new Document("doc", null, null);
pdf.parse(doc);
doc.clear();

doc.putAttr(Document.ATTR_PAGE, Integer.toString(1));
pdf.parse(doc);

Node top = doc.childAt(0);
doc.formatBeforeAfter(200, 200, null);
int w = top.bbox.width;
int h = top.bbox.height;
BufferedImage img = new BufferedImage(w, h,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
g.setClip(0, 0, w, h);

g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
Context cx = doc.getStyleSheet().getContext(g, null);
top.paintBeforeAfter(g.getClipBounds(), cx);
ImageIO.write(img, "jpg", outfile);
doc.removeAllChildren();
cx.reset();
g.dispose();

pdf.getReader().close();
outfile = null;

doc = null;
} catch (Exception e) {
}
}*/

public boolean convertPdfToJpeg(String input, String output){

boolean blnSuccess = false;
File outfile = new File(output);

PDF pdf = (PDF) Behavior.getInstance("AdobePDF", "AdobePDF", null,null, null);
File infile = new File(input);
pdf.setInput(infile);

Document doc = new Document("doc", null, null);
pdf.parse(doc);
doc.clear();

doc.putAttr(Document.ATTR_PAGE, Integer.toString(1));
pdf.parse(doc);

Node top = doc.childAt(0);
doc.formatBeforeAfter(200, 200, null);
int intImageWidth = top.bbox.width;
int intImageHeight = top.bbox.height;
BufferedImage theNewImage = new BufferedImage(intImageWidth, intImageHeight,BufferedImage.TYPE_INT_RGB);
Graphics2D loGraphics = theNewImage.createGraphics();
loGraphics.setClip(0, 0, intImageWidth, intImageWidth);
loGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
loGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
loGraphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
Context cx = doc.getStyleSheet().getContext(loGraphics, null);
top.paintBeforeAfter(loGraphics.getClipBounds(), cx);
try{
ImageIO.write(theNewImage, "jpg", outfile);
theNewImage = null;
blnSuccess = true;
}catch(ImageCreateException e){
theNewImage = null;
return(blnSuccess);
}

doc.removeAllChildren();
cx.reset();
loGraphics.dispose();

pdf.getReader().close();
outfile = null;

doc = null;
return(blnSuccess);
}

}

OPENLASZLO is an event-driven, object-oriented language for building dynamic, data-driven applications. Because it's an XML language, OPENLASZLO integrates seamlessly with your existing IDE, source control, and team development systems
OPENLASZLO is similar to rich internet platform for GUI
The source code for an OpenLaszlo application is an XML document, or a collection of XML documents. Every OpenLaszlo application begins with a set of tags. Other tags are then included to add functionality to the application. In this example, the tag was used to display 'Hello World'. Every tag has attributes that allows you to modify their appearance or behavior. To experiment in the example above try changing...

A view is the most basic viewable element in LZX. A view can be used as:

* a basic UI component
* a container to display media assets (images, music, video, ...)
* a container to lay out other components
* a starting point to create your own components using inheritance

The main problem of openlaszlo technology which i faced while developing applications is its bad performance. that means it lacks performance .for executing large amount of operation like passing details 500 entities into database or updation takes more time.everything we are implementing inside dataset with the help of xml