Searching for text containing diacritics (accents)
iTunes doesn't find titles when searching for texts containing diacritics (like "âàéêèëîïôöûùü", in french). Even when a song title is copied and pasted in the search field, it is still not found. I get the same problem when I call the search from AppleScript. When searching for only the part before or the part after the diacritic, then iTunes does find something. I think it is a bug. Is there someone that knows what to do?
Too bad the problem is back with the new iTunes 8.0. It is quite annoying since I got a lot of entries with those diacritics...
Similar Messages
-
Acrobat 10: We cannot search for words containing French accents.
For example, if we copy a word like "Transporté" and paste it in the search field in Acrobat (Reader, Standard and Pro), it appears "transport´e" and the search fails.
What app are you copying from? It works for me to paste (for example) café from NotePad. It also works to type café directly into the search box.
-
Problems with searching for text in Preview
Hi, everyone...I'm hoping someone can help me out with this. I have an old MBP with Tiger installed and Preview 3.0.9. I have attempted to search for words in numerous PDF files and the search function NEVER brings up the words even when I know the words are contained in the document. I read the Preview manual and I know I'm following the correct procedures in searching for text, but nothing seems to work. Can anyone help me out with what I may be doing wrong? Thanks!
I can't picture what you could possibly be doing wrong, there's not much choice in the matter.
The only time Searching fails here is if the text in the PDF is actually only a graphic of the text.
Are these PDFs that you made? If so, what APP?
If you down load this PDF, does Search work on it?
http://web.fastermac.net/~bdaqua/TestText.pdf -
I have an 800 page pdf document to index and so far I have a script that will search for a list of keywords. But the text has large sections of code in a different font, and I think we would like to generate an index of just code examples. Is there a way to search for text of a given font in applescript? Something like
set theSel to find text theText
if the font of theSel is "Times"
write to file, etc.Please do send a page, I might be able to spot where the font problem is coming from - but no guarantee Address is in my profile.
You asked about the script formatter. red_menace of this forum wrote the script I use. To use it, you copy the script that you want to format to the clipboard and run the formatter. This then places the marked-up text in the clipboard so that you can paste it into the forum page.
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;">
script formatter - formats the clipboard text for forum posting
last reviewed January 19, 2009 red_menace[at]mac[dot]com
Input: text read from the clipboard
Output: formatted text copied to the clipboard
set AppleScript's text item delimiters to " "
-- some constants and switches
property TextColor : "#000000" -- black (see http://www.w3schools.com/tags/ref_colornames.asp)
property BackgroundColor : "#FFDDFF" -- a light plum/purple
property BorderColor : "#000000" -- black
property TheWidth : "width: 720px; " -- a width attribute (deprecated in HTML 4.01)
property UseWidth : true -- use the width attribute?
property LineCount : 25 -- the number of lines before including the height attribute
property TheHeight : "height: " & ((LineCount * 13.6) as integer) & "px; " -- a maximum height for the <pre> box
property Emphasize : false -- emphasise (bold) the script text?
property UseURL : false -- include a Script Editor message link?
property AltURL : false -- use an alternate URL encoding?
property ToolTips : {¬
"this text can be pasted into the Script Editor", ¬
"this text can be pasted into an Automator 'Run AppleScript' action", ¬
"this text can be pasted into an Automator 'Run Shell Script' action", ¬
"this text can be pasted into a HTML editor", ¬
"this text can be pasted into a text editor", ¬
"- none -"}
property TooltipDefault : {item 1 of ToolTips} -- keep track of the last tooltip used
property TempFile : "Script_Formatter_TempFile" -- a temporary work file
try
-- write the clipboard to the temporary file
set TheClipboard to (the clipboard) as text
if TheClipboard is in {"", space, tab, return} then return -- clipboard is (basically) empty
set MyOpenFile to open for access ("/tmp/" & TempFile & ".txt" as POSIX file) with write permission
set eof of MyOpenFile to 0 -- empty any previous temp file
write TheClipboard to MyOpenFile
close access MyOpenFile
if UseURL then
-- encode URL (see http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/pydoc.1. html)
do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of TheClipboard
-- add a link wrapper
set URLtext to "applescript://com.apple.scripteditor?action=new&script=" & the result
if AltURL then -- use an alternate URL encoding
set URLtext to "Click here to [url=" & URLtext & "]open this script in the Script Editor[/url]:<br />"
else -- use HTML anchor tag
set URLtext to "Click here to <a href=\"" & URLtext & "\">open this script in the Script Editor</a>:<br />"
end if
set PromptText to ((count URLtext) as text) & " URL and "
else
set {URLtext, PromptText} to {"", ""}
end if -- UseURL
-- convert to HTML (see http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/textutil .1.html)
do shell script "cd /tmp/; /usr/bin/textutil -convert html -excludedelements '(html, head, title, body, p, span, font)' -encoding US-ASCII " & TempFile & ".txt"
-- fix up some formatting and add a pre wrapper (see http://www.w3schools.com/tags/default.asp)
set HTMLtext to rest of paragraphs of (read ("/tmp/" & TempFile & ".html" as POSIX file))
if (count HTMLtext) is less than LineCount then -- skip the height attribute
set Height to ""
else
set Height to TheHeight
end if
set HTMLtext to FixCharacters from (HTMLtext as text) -- additional character encodings
if UseWidth then
set Width to TheWidth
else
set Width to ""
end if
if Emphasize then set HTMLtext to "<strong>" & HTMLtext & "</strong>"
set HTMLtext to "<pre style=\"
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid " & BorderColor & ";
" & Width & Height & "
color: " & TextColor & ";
background-color: " & BackgroundColor & ";
overflow: auto;\"
title=\"\">
" & HTMLtext & "</pre>
-- assemble everything on the clipboard
set TheResult to choose from list ToolTips ¬
with title "Script Formatted" with prompt PromptText & ((count HTMLtext) as text) & " HTML characters will be placed on the clipboard (plus the following ToolTip):" default items TooltipDefault OK button name "OK" cancel button name "Cancel" with empty selection allowed without multiple selections allowed
if TheResult is false then -- cancel button
error number -128
else -- add the selected title attribute (tooltip), if any
set TooltipDefault to TheResult as text
set Here to (offset of " title=" in HTMLtext) - 1
set There to (offset of ">" in HTMLtext) - 1
if TheResult is in {{}, "- none -"} then -- no tooltip
set the clipboard to URLtext & (text 1 thru (Here - 1) of HTMLtext) & (text (There + 1) thru -1 of HTMLtext)
else
set the clipboard to URLtext & (text 1 thru (Here + 9) of HTMLtext) & TheResult & (text There thru -1 of HTMLtext)
end if
end if -- TheResult is false
on error ErrorMessage number ErrorNumber
log space & (ErrorNumber as text) & ":" & tab & ErrorMessage
try
close access MyOpenFile
end try
if (ErrorNumber is -128) or (ErrorNumber is -1711) then -- nothing (user cancelled)
else
activate me
display alert "Error " & (ErrorNumber as text) message ErrorMessage as warning buttons {"OK"} default button "OK"
end if
end try
to FixCharacters from TheText
fixes (converts) formatting characters used in some message forums (see http://www.asciitable.com/)
parameters - TheText [text]: the text to fix
returns [text]: the fixed text
-- this list of lists contains the characters to encode - item 1 is the character, item 2 is the HTML encoding
set TheCharacters to {¬
{"!", "!"}, ¬
{"*", "*"}, ¬
{"+", "+"}, ¬
{"-", "-"}, ¬
{"[", "["}, ¬
{"\\", "\"}, ¬
{"]", "]"}, ¬
{"^", "^"}, ¬
{"_", "_"}, ¬
{"~", "~"}}
set TempTID to AppleScript's text item delimiters
repeat with SomeCharacter in TheCharacters
if item 1 of SomeCharacter is in TheText then -- replace
set AppleScript's text item delimiters to item 1 of SomeCharacter
set the ItemList to text items of TheText
set AppleScript's text item delimiters to item 2 of SomeCharacter
set TheText to the ItemList as text
end if
end repeat
set AppleScript's text item delimiters to TempTID
return TheText
end FixCharacters
</pre> -
PDF Search: Escape chars / search for words containing dots
Hello,
i'm trying to do a search for ip adresses in a pdf document - eg for "10.100.0.1" - but it seems that adobe reader doesnt cope with the included dots.
Is there a way to search for words containing dots? Maybe some way of escaping the dot?
Thanks,
MoritzReader can find dots just fine. There's probably something going on with your file, like font issues or spaces between the text, or something like that.
-
Editor: Annoying pop-up for choosing main programs when searching for text
Hi,
We're upgrading to ECC60 and are getting frustrated when searching for text in a source code within the ABAP editor.
For every include contained in the main program you are searching in there is a pop-up asking to choose the main program for that include.
This can get crazy when searching in a standard SAP program such as SAPMV45A. You'll have to process through 30-40 of these pop-up windows before your search results appear. I each pop-up you have to scroll though dozens of main programs to find the one you are doing the search in.
Can this be turned of somehow to have the search functionality work as it did in previous version, where the Editor knows that the program you are launching the search from is the main program you want the results from?
Thanks,
PeterHI Peter
Please check if program: <b>RPR_ABAP_SOURCE_SCAN</b> can help you...
Regards
Eswar -
Is it possible to search for strings containing spaces and special characters?
In our RoboHelp project, there are figures with text labels such as Figure 1, Figure 3-2, etc.
When I search for "Figure 3" I get all pages containing "Figure" and "3", even if I surround it in quotes. Similarly, searching for "3-2" treats the '-' character as a space and searches for all pages containing '3' or '2'.
Is there a way to search for strings containing spaces and special characters?In that case I think the answer is no if you are using the standard search engine. However I believe that Zoom Search does allow this type of searching. Check out this link for further information.
http://www.grainge.org/pages/authoring/zoomsearch/zoomsearch.htm
The RoboColum(n)
@robocolumn
Colum McAndrew -
Dreamweaver cs5.5 opening files after searching for text code
This just occured this afternoon. I was working on a page and when I went to search for text in the code (ie "/head") dreamweaver would open a previously opened page. In other words I was working on "walk.php" and when I did the search for "/head", dreamweaver opens "add_rsurvey_data.txt". I know what the 2nd file is but I haven't opened it in months. It's just a temp data file that my partner sent me.
I'm using cs5.5
Adobe will not help me.
Thanks
GlennWe don't get attachments from email replies here. You would need to use the Camera icon in the actual web forum to a post screen shot.
If this began yesterday, try deleting your Cache & restarting DW.
http://forums.adobe.com/thread/494811
Nancy O. -
How do I search for text on a webpage?
I have found some answers for mobile devices, but how do I search for text on a webpage for my notebook?
You will find command F is fairly universal.
good computing -
"Search for text" Zooms when number keys pressed. Expecting it to FIND text
For months I have been using (&relying on) the "search for text when I start typing " feature.
I am a school teacher & this helps me to search for students & record scores in an online grading program.
The "search for text when I start typing feature" stopped working two days ago.
Before, whenever I typed the "Find" box immediately opened up, searched the screen,
and highlighted whatever I had just typed. Now, when I enter a "1", "2" , "6" , "9" or "0" (zero)
the find box does not come up- so this disrupts all the grade recording process for me.
Instead, when I type in 6 or 9 (it zooms in the screen instead), 0 (it zooms out instead) and I cannot tell what happens
when I type in 1 or 2 (nothing appears to happen- but no "Find" box comes up.
Edit by a moderator to improve the title
(As suggested by a contributor, flagging the post)
Was
*The Firefox "search for text when I start typing feature" has just stopped working correctly
Now
*"Search for text" Zooms when number keys pressed. Expecting it to FIND text
~J99
I tried restarting Firefox and turning on/off the Advanced feature ( "search for text when I start typing feature")
but it did not help. I am using a Mac. I also tried using an external keyboard/keypad but the exact same
results occur.
Please help!
Thanks,
BarryThe keyboard shortcut for resetting the zoom level is Command+0, so seeing that kind of response implies that Firefox is misreading the state of the Command key, thinking it is stuck down. Usually tapping the key numerous times will send a signal to all programs that the key has been released (at least on Windows).
On the other hand, in that case, Command+6 should jump to the sixth tab in the current window, it shouldn't change the zoom level. So... hmm...
In case a component of the OS has malfunctioned, have you already tried shutting down the system completely and then starting it up again? -
Spotlight search for text messages not working
After upgrading to ios8, I discovered that the spotlight search for text messages only "sees" my last two texts but not any of the others I have on my phone. These are all active conversations, not deleted messages. Any ideas how to fix? Thanks.
I Fixed mine by going to setting->General->Sptolight and unchecking "messages", exiting the function then returning and rechecking "messages".
-
I have checked “Search for text when I start typing” but it is not happening since your latest update. This is very important to me as I keyboard - not use the mouse. What can I do? Also, before the last update I could leave the window (alt+tab) and return and just type and it would type it is the search box. Now I have to take my hand off the keyboard and get the mouse three times for every search, slowing my work way, way down. What other flag do I need to put this back the way it was? Should I also remove the “Automatically check for updates” so that this will not happen again? Please, please help.
Hi CynthiaP,
You should look at the article [http://kb.mozillazine.org/Preferences_not_saved Preferences not saved]. It may just be an issue with the pref file!
Hopefully this helps! -
Search for text when I start typing, I want to disable it but it doesn'
I chat in chat rooms from time to time and I find it bothersome when every time I start to type the computer starts to search for text. I have gone to firefox options and it is not enabled but search it does. Can you suggest a way that I can stop that from happening?
Thank you
SherrieSee:
*http://kb.mozillazine.org/Find_bar_opens_when_typing_in_textbox
*searchhotkeys: http://nic-nac-project.de/~kaosmos/index-en.html#searchkeys -
Applescript Help: Search for text in Safari DOM tree
Im trying to make a script really similar what was asked here: Re: Find text in webpage and email notification applescript/automator Except instead of searching the "source code" of the page, I want the script to search the "DOM tree" for the page.
To summarize, I am trying to make a script that loads a safari page, searches for a particular text in the DOM Tree, and if found will send me an email.
Here is the code from the other thread I referenced:
on idle
set pagURL to "http://page.url.com?whatever"
if application "Safari" is not running then
quit
return
end if
tell application "Safari"
set URL of document 1 of window 1 to "http://your.web.address/"
delay 5
-- delay to let page load.
if source of document 1 of window 1 contains "search text" then
my sendAMail()
end if
return 900 --fifteen minutes
end tell
end idle
on sendAMail()
tell application "Mail"
set theMess to make new outgoing message at end with properties {sender:"your name", subject:"some subject line", content:"The message you want to send to yourself", visible:true}
tell theMess
make new to recipient at end of to recipients with properties {address:"[email protected]"}
end tell
-- send theMess
end tell
end sendAMail
Any help would be appreciated!For the URL you quote as an example (http://www.sislands.com/coin70/week2/NestedLoops1.htm), using text instead of source worked for me:
if text of document 1 of window 1 contains "1 2 3 4" then
another example:
if text of document 1 of window 1 contains "10 12 14 16" then
Note a double space between single digits (1 2 3 4) and a single space between double digits (10 12 14 16) is required for a match as per the table format:
Any full line:
if text of document 1 of window 1 contains "for (i = 1; i <= 10; i++) { // when i = 10" then
or partial line works:
if text of document 1 of window 1 contains "; i++) { // when i = 10" then -
Search for description containing non-English chars -- ?
Hello!
I've implemented a search class, which allows customers to search folders/documents by name, owner, description, etc.
And here's the problem: if description contains non-English (Russian, in my case) characters, search does not work! Everything (AS infrastructure, CM SDK DB, etc) was installed using UTF-8 Unicode charset. When I debug the code, I see that when I build AttributeQualification and later compose a comples SearchQualification, value in these is correct, but when I call getSQL(), I see string like this:
... ( nls_upper(ALIASDOCUMENT.DESCRIPTION) LIKE nls_upper('????') ) ...
So it seems as if SQL converted passed UNICODE value into ANSI string, and since server's system language is English, my Russian letters were lost -- ?
Can anybody shed some light here? Is there a way to search for UNICODE descriptions (and content, for that matter)?
Thanks,
Sasha.Hi Sasha,
I want you to try the following code. It should output the file description and query to a text file. Use internet explorer / or notepad to open this file and ****specify that the file encoding is UTF8.*****
thanks,
matt.
java -classpath ...blah blah.. RussianSearch parameterfile=c\cmsdkparameters.txt
cmsdkparameters.txt contains:
Username = system
Password = oracle9i
SchemaPassword = cmsdk
Domain = ifs://ifspm-sun2.us.oracle.com:1521:mjs92.us.oracle.com:cmsdk903
ServiceConfiguration = SmallServiceConfiguration
Service = TestService
import oracle.ifs.beans.LibraryService;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.beans.ClassObject;
import oracle.ifs.beans.Document;
import oracle.ifs.beans.DocumentDefinition;
import oracle.ifs.beans.Folder;
import oracle.ifs.beans.FolderDefinition;
import oracle.ifs.beans.LibraryObject;
import oracle.ifs.beans.PublicObject;
import oracle.ifs.beans.Search;
import oracle.ifs.beans.SearchResultObject;
import oracle.ifs.common.IfsException;
import oracle.ifs.common.AttributeValue;
import oracle.ifs.common.CleartextCredential;
import oracle.ifs.common.Credential;
import oracle.ifs.common.ParameterTable;
import oracle.ifs.search.AttributeQualification;
import oracle.ifs.search.AttributeSearchSpecification;
import oracle.ifs.search.SearchClassSpecification;
import oracle.ifs.search.SearchSortSpecification;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Hashtable;
import java.util.Vector;
* Copyright (c) 2003 Oracle Corporation. All rights reserved.
* Matt Shannon.
* Description:
* Test searching in Russian Language
* View output file in notepad or IE - make sure to specify character
* set of document to be UTF8 when opening.
public class RussianSearch implements Runnable
// set to 'false' to prevent the class from freeing objects that it creates
public static final boolean performCleanup = true;
protected ParameterTable m_parametertable;
private Vector m_ObjectsRequiringCleanup;
public RussianSearch(String[] args)
// parameter file is retrieved through command line argument parameterfile=
m_parametertable = new ParameterTable(args, "parameterfile");
public static void main(String[] args)
new Thread(new RussianSearch(args)).start();
* This is where you write your test program.
public void run()
LibraryService service = startService();
LibrarySession session = establishSession(service);
if (session == null)
return;
try
DocumentDefinition ddef = new DocumentDefinition(session);
ddef.setAttribute(PublicObject.NAME_ATTRIBUTE,
AttributeValue.newAttributeValue("blah.txt"));
ddef.setAttribute(PublicObject.DESCRIPTION_ATTRIBUTE,
AttributeValue.newAttributeValue("Я скучаю по родине"));
ddef.setEmptyContent();
Document newdoc = (Document) session.createPublicObject(ddef);
addObjectRequiringCleanup(newdoc);
/* Construct AttributeSearchSpecification.
* Attribute based conditions are allowed, context conditions are not!
AttributeSearchSpecification attrSrchSpec =
new AttributeSearchSpecification();
/* Construct SearchClassSpecification.
* This represents the FROM and SELECT clauses of the query.
SearchClassSpecification srchClsSpec = new SearchClassSpecification();
srchClsSpec.addSearchClass(Document.CLASS_NAME); // from clause
srchClsSpec.addResultClass(Document.CLASS_NAME); // select clause
/* Construct SearchSortSpecification.
* This represents the ORDER BY clause of the query.
SearchSortSpecification srchSortSpec = new SearchSortSpecification();
// upper case ascending sort on Name
srchSortSpec.add(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE,
SearchSortSpecification.ASCENDING, "nls_upper");
/* AttributeQualification is a WHERE clause component representing an
* attribute condition.
// scalar AttributeQualification - name like '%.html'
AttributeQualification aq = new AttributeQualification();
aq.setAttribute(Document.CLASS_NAME, PublicObject.DESCRIPTION_ATTRIBUTE);
aq.setOperatorType(AttributeQualification.LIKE);
aq.setValue("%родине");
// set SELECT & FROM clauses
attrSrchSpec.setSearchClassSpecification(srchClsSpec);
// set ORDER BY clause
attrSrchSpec.setSearchSortSpecification(srchSortSpec);
// set WHERE clause
attrSrchSpec.setSearchQualification(aq);
/* Construct Search, supply SearchSpecification */
Search s = new Search(session,attrSrchSpec);
System.out.println("File encoding system property: "+System.getProperty("file.encoding"));
boolean append = false;
FileOutputStream fos = new FileOutputStream("c:/test.txt",append);
OutputStreamWriter osw = new OutputStreamWriter(fos);
System.out.println("Default character encoding: "+osw.getEncoding());
osw = new OutputStreamWriter(fos,"UTF8");
System.out.println("New character encoding: "+osw.getEncoding());
PrintWriter out = new PrintWriter(osw,true);
out.println(s.getSQL());
SearchResultObject obj = null;
// Open Search!
s.open();
try
* A SearchResultObject encapsulates a row of a search result. It
* contains 1 or more LibraryObjects (depending on number of result
* classes specified).
while ( (obj = s.next()) != null )
Document d = (Document)(obj.getLibraryObject(Document.CLASS_NAME));
out.println(d.getName() + " " + d.getDescription());
catch (Throwable e)
if ((e instanceof IfsException) &&
(((IfsException)e).containsErrorCode(22000)))
else
System.out.println("Unexpected exception occurred in selector cursor");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
finally
out.close();
if (performCleanup)
cleanup();
s.close();
s.dispose();
catch (Throwable e)
System.out.println("Fatal exception occurred in run():");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
finally
disconnectSession(session);
public LibraryService startService()
String schemapassword = m_parametertable.getString("SchemaPassword");
String domain = m_parametertable.getString("Domain");
String servicename = m_parametertable.getString("Service",domain);
String serviceconfiguration =
m_parametertable.getString(
"ServiceConfiguration","SmallServiceConfiguration"
LibraryService service = null;
try
if (servicename != null &&
LibraryService.isServiceStarted(servicename))
// The service name was specified, and is already running.
// So just use it.
System.out.println("Service already running: "+servicename);
service = LibraryService.findService(servicename);
System.out.println("Existing service retrieved");
else
service = LibraryService.startService(
servicename, schemapassword, serviceconfiguration, domain);
System.out.println("Service started: '"+servicename+
"' (version: "+service.getVersionString()+")");
catch (Throwable e)
System.out.println("Unable to start service:");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
return service;
public LibrarySession establishSession(LibraryService service)
String username = m_parametertable.getString("Username");
String password = m_parametertable.getString("Password");
return establishSession(service, username, password);
public LibrarySession establishSession
LibraryService service,
String username,
String password
LibrarySession session = null;
try
CleartextCredential cred = new CleartextCredential(username,
password);
session = establishSession(service, cred);
catch (Throwable e)
System.out.println("Unable to create credential:");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
return session;
public LibrarySession establishSession
LibraryService service,
Credential cred
LibrarySession session = null;
if (service != null)
try
String username = cred.getName();
session = service.connect(cred, null);
System.out.println("Session established for " + username);
catch (Throwable e)
System.out.println("Unable to create session:");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
return session;
public void disconnectSession(LibrarySession session)
System.out.println("Disconnecting session");
try
session.disconnect();
catch (Throwable e)
System.out.println("Error disconnecting session:");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
public void addObjectRequiringCleanup(LibraryObject lo)
Vector v = getObjectsRequiringCleanupVector();
v.addElement(lo);
private Vector getObjectsRequiringCleanupVector()
if (m_ObjectsRequiringCleanup == null)
m_ObjectsRequiringCleanup = new Vector();
return m_ObjectsRequiringCleanup;
* Frees objects that were marked as requiring clean up
public void cleanup()
Vector v = getObjectsRequiringCleanupVector();
System.out.println("Cleanup - delete objects created during the session");
int count = (v == null) ? 0 : v.size();
System.out.println("# of objects to free: "+count);
// Free the objects in reverse order from which they were added
for (int i = count - 1; i >= 0; i--)
LibraryObject lo = (LibraryObject)v.elementAt(i);
try
discardObject(lo);
catch (Exception e)
System.out.println("Unable to discard an object during cleanup - continuing...");
public void discardObject(LibraryObject lo) throws IfsException
if (lo != null)
try
System.out.println("Attempting to free: "+getDisplayName(lo));
LibrarySession session = lo.getSession();
if (lo instanceof Folder)
System.out.println("Attempting to free Folder with Deep Option!");
// free Folder using "Deep" option to free
// all items in the folder, and all of their items, etc.
Folder folder = (Folder)lo;
FolderDefinition def = new FolderDefinition(session);
def.setFolderDepthOption(
Folder.SYSTEMOPTIONVALUE_FOLDER_DEPTH_DEEPEST);
folder.free(def); // removes object from the repository, with options
else
// just a regular free
lo.free();
catch (Exception e)
System.out.println("Unable to free an object during cleanup - continuing");
System.out.println((e instanceof IfsException)
? ((IfsException)e).toLocalizedString()
: e.toString());
public String getDisplayName(LibraryObject lo)
throws IfsException
String displayName;
if (lo != null)
displayName = lo.getClassObject().getName()
+ " '" + lo.getName() + "'";
else
displayName = "<null object>";
return displayName;
}
Maybe you are looking for
-
Do I have to eject my Iphone 5 when charging via USB?
I know pulling my older shuffle out of the dock (without using eject button) can create a need for a reset, but can I just unplug my Iphone 5 without using the powering on the monitor and hunting down the eject button after I have been simply chargin
-
My Mother in law messed up my Adobe reader some how to the point that it is no longer in my computer. I have tried to download it from the internet but it is not working. What am I missing? what else do I need to do? I am not even able to watch youtu
-
Add a new column for WBS description
Hi all how to Add a new column for WBS description and derive the value as per the FS anybody can provide document for this
-
Strange folders appearing in "Save As" dialog box
Hello *Description of Problem or Question: If you open a Web Intelligence report that has been sent to you from your Inbox I have noticed there are "extra" folders I wouldn't expect to see. As an administrator and can see the following extra "strange
-
Hitting 'F4' in IE would display recently visited web sites under the address bar. This made it easy to use the keyboard (rather than the mouse); once the list web sites appeared, you could use the cursor buttons to move to the site you wanted, and h