Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
relative path
Vallari
Hi,
this mail is a continuation of ym previous mail.i had a problem when i would give a realtive path in the DCR it gave me the error which i am attaching in the file.Also the workflow that is followed is attached below.Can you help me in modifying this code(for workflow) so that is accepts the relative path also in the dcr.
Find more posts tagged with
Comments
Vallari
the error message is attached below
Adam Stoller
Your workflow, to say the least, is convoluted. You do not seem to be attaching *just* the actual pre-selected file, but instead you appear to be processing any pre-selected file if it ends with ".shtml" or or ".html" and then extracting out entries within there to add:
if (__ELEM__('iw_file')) {
__INSERT__("<files>\n");
foreach my $file (__VALUE__('iw_file')){
$file=TeamSite::CGI_lite->escape_html_data($file);
__INSERT__("<file path='$file' comment='Submitted.'/>\n");
if ($file =~ ".shtml" or $file =~ ".html") {
$thisFile="Y:$AREAVPATH/$file" ;
open(HTMLFILE,"<$thisFile") ;
while ($line = <HTMLFILE>) {
if ($line =~ '<meta name="Content File"') {
my $contentpos = index("$line","content=") + 9 ;
my $content = substr("$line",$contentpos) ;
($contentFile,$rest) = split('"',$content) ;
if ($contentFile ne "#") {
__INSERT__("<file path='$contentFile' comment='Associated content.'/>\n");
}
}
}
close(HTMLFILE) ;
}
}
__INSERT__('</files>');
}
This makes it a bit difficult to determine what happened based solely on the information you've provided. Could you post the contents of
$IWHOME/local/logs/wf.debug.out.xml.txt
? That might help clarify the situation a bit.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Hi,
I am sending you the wf.debug.out.xml file.
I guess the variable AREAPATH which is defined till work is caud=sing a problem.
should i define it as
($AREAPATH=__VALUE('iw_workarea'))=~s/^.*?\Q$IWMNT\E//
can you please help me in resolving this issue
Adam Stoller
The difference between the pre-selected file and the files listed within the pre-selected file appears to be the leading '/' character:
<files>
<file path='content/HansWessel_content_test.shtml' comment='Submitted.'/>
<file path='/images/Benelux_images/header performance.jpg' comment='Associated content.'/>
<file path='/images/Benelux_images/lpgass.jpg' comment='Associated content.'/>
<file path='/documents/Taradocuments/CoW_Project plan.xls' comment='Associated content.'/>
</files>
Assuming that from the top of your workarea you can see all three directories: content, images, and documents - the solution would probably be to add a line of code just prior to the insertion of the included entries:
if ($contentFile ne "#") {
$contentFile =~ s|^/||;
__INSERT__("<file path='$contentFile' comment='Associated content.'/>\n");
}
If those directories
do not
appear at the top of your workarea - then there's a bigger problem and more information about the environment would be needed to help resolve the issue - which makes it difficult to debug remotely like this.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
hi,
should i make these changes in the wf.output.file.out or in the submit wokflow.
since wf.outout.file is an xml file and this seem to be a perl code.should i insert this code in the workflow file
regards
Adam Stoller
The change is for the WFT - where the code exists that generated the output file.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Hi,
Tried to modify the WFT file,but it still gives me the same error.Can you tell me ,is it beacuse AREAPATH in wft.output.xml is set till work..if u see the code.
So,when we try to submit a DCR that has relative links,it searches for those files under work and not under the relative directory.I ahve sent you the workflow script and also the wft.ouput.xml .txt ,...can you please help me out with this.
Since this workflow basically minimises the user interaction...ie it does not ask for approval from the user..it directly submit,publishes ansd deploys once you click on submit button....
Regards
Adam Stoller
Since I don't have a firm comprehension of your tree structure - can you explain the path relationships between:
content/HansWessel_content_test.shtml
images/Benelux_images/header performance.jpg
images/Benelux_images/lpgass.jpg
documents/Taradocuments/CoW_Project plan.xls
relative to the root of the workarea /default/main/Development/Intranet Development/WORKAREA/work ?
E.g.:
.../work/content/
.../work/images/
.../work/documents/
If that's the case - the code should work as-is.
If that's not the case - we need to understand how these directories relate to one another before we can attempt to explain how to resolve your issues.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Hi,
You are right.These directories are directly lying under work.So i guess when we attach a file in the DCR ,it searched for file from work.
for example:lemme explain to you the directory structure of the workarea.
work
content
digital_business
projects
bu_mi(this directory has a number of (documents--word ,excel and an shtml page and also sub-directories like oyster and under oyster u again have sub-directories and files).If u open the error document things will be clear.
bu_mi_roll_out
images(thus directory contains number of images and also sub-directories containing images)
documents
i can send u the snapshot of the workarea..
Regards,
gauri
lhdavis
The spacing probably did not do what you wanted for your post and the image you attached did not show all of the directories you are describing. Here's is what I have so far:
- Your workarea is named "work"
- The top level directory is "content"
- Second level directory to content is "digital_business"
- Third level directory to digital_business is "projects"
- Fourth level directories to projects are "bu_mi" and "bu_website_rollout" (is that the same as bu_mi_roll_out?)
Not sure where images and documents fall yet and you didn't include that part in your screenshot. These paths are important as you are trying to refer to documents using a relative path and it doesn't seem (as yet) that you have the correct path.
Luke Davis
Open Technology Group, Inc.
luke.davis@med.va.gov
Vallari
Hi,
Images and document directory come under work.
i am sending you the snapshot
regards
lhdavis
It would be nice if you could also provide what the "relative path" values are for the related links in the DCR. I'm assuming you are using a browse button in the DCR. What are the actual values saved for the relative paths?
And does the code only "break" for files that are several subdirectories deep? Your example of images and documents are at the one level below images and documents which are at the same level as your content directory. The error message you posted was for a file that exists five levels down. It would be helpful to test this case to see if it works up to a certain depth of subdirectory.
Also, looking at your wf.debug.out.xml file, do some of your documents have spaces in their names? There are two listed that do:
/images/Benelux_images/header performance.jpg
/documents/Taradocuments/CoW_Project plan.xls
Not sure how other's feel but I defintiely would recommend to always use an underscore rather than a space.
Luke Davis
Open Technology Group, Inc.
luke.davis@med.va.gov
Vallari
Hi ,
can you help me to define a variable $areapath in the XML file.
Because if you happen to see the xml variable areavpath v="/default/main/Development/Intranet Development/WORKAREA/work"/>.I guess this makes it look up for files under work.Incase i define it as ($AREAPATH=_VALUE_('iw-workarea'))=~s/^.*?\Q$IWMNT\E//;
Can i define this in the Xml file so that i performs a proper search.
Can you help me in doing this.
I will mail you the DCR in my next mail.
Regards
Vallari
Hi,
I am sending to you the snapshot of the DCR.......regarding the images path question,in the DCR when we brose the images we specify the path as /images....so it starts from the root...ie from work and images directory is present directly under root.So it does cause any conflict.
Regards
Vallari
Hi,
If you go thru the workflow file.....you can see there are variables like iw_user,iw_workarea and iw_role defined .
Can you tell me where these variables are defined/declared.
Regards
Adam Stoller
Those tag/form variables are defined by TeamSite - you can use them or not as you see fit.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
hi,
i am sorry for attaching the wrong wf.debug.outout .file.Hereby attaching the corret file
can you please have a look into this
Regards
Adam Stoller
If you look at the list of files attempting to be added to the job - you'll see that, once again the first path which is a pre-selected file does not begin with a '/', and that the second path appears to *NOT* be relative to the workarea - the remainder all appear to be relative to the workarea but begin with a '/'.
Since the "Associated content" is coming from the contents of the pre-selected file - you need to check that file to see if somehow the first line got munged; and at the same time probably remove all the leading '/'s.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com